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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -