Access Dynamically added elements in javascript with live()

Access Dynamically added elements in javascript with live()

Here, if you are adding some html elements dynamically,and want to perform some events on that, than you can’t access with .click() or .on() method.

You can use live() method to access dynamically added html elements.

Ex:

 


$('#remove').live('click',function(){

alert($(this).attr('id'));

});