jquery - selecting and deleting a row -
for adding rows wrote code this
$('#tab1 tbody ').append('<tr id='+i+'><td>'+k+'</td><td>'+l+'</td><td>'+m+'</td></tr>');
in previous snippet i
global value..
now if trying select newly added row not recognizing.. selecting wrote this
$('#tab1 td').click(function(){ alert(i); $(this).parent().remove(); });
do see mistakes?
i think td elements having invalid id's. id should not start numbers. try appending static text before i
.
also have use .live()
event elements generated in js
$('#tab1 td').live("click", function(){ alert(i); $(this).parent().remove(); });
Comments
Post a Comment