I have a function onclick that add HTML :
jQuery(".test").click(function() {
jQuery(this).prevAll("input").val("5")
jQuery(".after").append("<div><input /><a class='.test'>click doesn't work !</a></div>")
});
So, when I click on my class .test, the function is triggered. And that works, but I have appended another class .test and when I click on it, the function isn’t triggered. Why ?
Thanks.
Fiddle : http://jsfiddle.net/csL8G/3/
you can use
jQuery.on()method if you are using jQuery 1.7+for previous versions u can use
.live()or.bind()methods.