jquery listener don't "listen" to events on DOM elements dinamically created

Posted by luca on Stack Overflow See other posts from Stack Overflow or by luca
Published on 2010-03-17T15:20:40Z Indexed on 2010/03/17 15:21 UTC
Read the original article Hit count: 406

Filed under:
|
|
|

Hi,

i have a listener like this:

$('.delete').click(function() {
  ...some stuff
});

also, on the same page, another script dinamically add elements to the DOM in this way:

$('#list').append('<tr><td><a class="delete" href="#">delete</a></td></tr>');

my problem is that the listener doesn't "listen" to these dinamically created elements.

anyone can shed a light please :'(

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about event