How can I run jquery function for a .click() event on a element created by an ajax request ?
For a normal element it works, but I want to do this for an element created by the ajax request. And it’s not working …
$(".links").click(function(){alert("aaaa");})
a class="links" >1</a;
I’ve also tried with “links” as id.
I need it for a pagination system.
Please help 🙁
You need to run the code again to bind the click event handler, after the new element is inserted into the DOM. Alternatively, you may want to use .live().