On May 18, 2009, at 2:04 PM, naresh wrote:
Hi I have a query(JQuery) here. can you plz help me in fixing the issue with this code. That is when I click on <tr> of first table that should get removed from first table and added to second table. It is happening fine and good. But when I double click on the <tr> that is added to second table no event is triggered. Why? $("tr").dblclick(function(event){ var row = $(this).html(); $(this).remove(); $("#bottomTable").append("<tr>"+row+"</tr>"); }); do I need to call any method?
It looks like you're doing more than you need to. When you use .remove(), jQuery removes all event and data bindings from the element(s) as well. But you don't even need to remove the row.
Make sure you have a tbody in your table, then do this instead: $("tr").dblclick(function(event){ $(this).appendTo("#bottomTable > tbody"); }); --Karl ____________ Karl Swedberg www.englishrules.com www.learningjquery.com