5

I'm trying update a table cell using jeditable so when the user clicks the cell it becomes editable. Below code works fine :

    $(".click").editable("http://www.appelsiini.net/projects/jeditable/php/echo.php", { 
                indicator : "<img src='img/indicator.gif'>",
                tooltip   : "Click to edit...",
                style  : "inherit"
            });

<b class="click" style="display: inline">Click me if you dare!</b></> 

But when I try to edit a cell that has been dynamically added to the table using jQuery :

$("#rounded-corner tbody").append("<td class='clicked'>row</td>");

The event does not fire. How can this be fixed ? I think I may have to use the .on function ?

blue-sky
  • 51,962
  • 152
  • 427
  • 752

1 Answers1

2

Use the on() method -

$('body').on('click', '.click', function(){....
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119