there is a problem with javascript code on ajax content loaded.
i have a form with multiple inputs that loaded with this ajax code :
function listfetch(typeval)
{
var shopid = document.getElementById("shopid").value;
$.ajax({
type: 'post',
url: 'select.php',
data: {
brand:typeval,
shopid:shopid
},
success: function (response) {
$('#pricelist').html(response);
}
});
}
result of above code loaded in below div
<div id="pricelist"></div>
now, i have a javascript code for navigation on inputs by tabindex number with arrow keys:
<script>
$(document).ready(function(eOuter) {
$('input').on('keydown', '.pricelist' , function(eInner) {
var tabindex = $(this).attr('tabindex');
if (eInner.which === 37) { //left
tabindex++;
$('[tabindex=' + tabindex + ']').focus();
}
if (eInner.which === 39) { //right
tabindex--;
$('[tabindex=' + tabindex + ']').focus();
}
if (eInner.which === 38) { //down
tabindex-=3;
$('[tabindex=' + tabindex + ']').focus();
}
});
});
</script>
but above code not working on loaded content inputs.
note: loaded content show on browser but not exist on html page source code
please help me
thanks