I’m using an AJAX request to add some pages into my JQuery mobile site.
But after adding buttons I cannot access those using the class I set before.
Is there a way to inform JQuery that I updated the DOM and that there are new buttons with the class?
adding the button:
echo "<a data-role=\"button\" class=\"delbtn\" data-transition=\"fade\" data-icon=\"delete\">Delete</a>";
accessing the button:
$(".delbtn").click(function(){
//some action..
});
you have to bind a live event handler (jQuery ON) because your buttons are added dynamically