Skip to content Skip to sidebar Skip to footer

Jquery Click Not Applied To Repainted/injected Items

I have a simple piece of jQuery which injects a new row (...) which contains a select, a text box and some radio buttons to an existing table using the following: $(':radio').click

Solution 1:

You could use delegate():

$('#bdTable').delegate(':radio', 'click', function(){
     $('#bdTable tr:last').after(makeHTML());
});

Solution 2:

Use live as below

$(':radio').live("click", function() {
    $('#bdTable tr:last').after(makeHTML());
});

Solution 3:

Check out jQuery'slive() function.

$(':radio').live('click', function() {
  $('#bdTable tr:last').after(makeHTML());
});

Solution 4:

Use:

$(':radio').live(function() {
    $('#bdTable tr:last').after(makeHTML());
});

Post a Comment for "Jquery Click Not Applied To Repainted/injected Items"