I have this function:
$(".action").click(function(){
$.get('suppliers/template/get_options_list.php?action='+action+'&id='+id+'&optvalue='+optvalue+'&pid='+pid+'',
update_options);
}
});
function update_options(options){
$('#selectedoptions').html(options);
}
It works fine for the first click trigger but after ajax returns results next click doesnt fire.. No errors, console is clear but stilll
What could cause this? Thanks
.actionelement is inside#selectedoptionselement, it is either doesn't exist after replacing html or it is replaced with same one, and then it is time to use delegated event handler$('#selectedoptions').on('click', ".action", function() {update_optionsupdate the HTML that contains.actionelements? If so, you'll need to delegate your click event. Hah, yeah, what Regent said.}in your click function. Is this code even running?