Tags

Select dynamic object by using “live()”

http://api.jquery.com/live/

 

example:

$(“normal”).click(function(event) {
event.preventDefault();
var name = $(this).attr(‘name’);
alert(name);
});

$(‘.dynamic’).live(‘click’, function(e) {
e.preventDefault();
var name = $(this).attr(‘name’);
alert(name);
});

Advertisements