I created rows of table Dynamically by jquery, I also add a remove button on each row,and add an event on this button by which the row corresponding to that button(in a row) is removed when we click on that button,But my broblem is only upper three buttons are active and fired,and the buttons which are at last are not able to work.
$(function(){
$('<input></input>')
.attr({'type': 'button'})
.val("Remove")
.appendTo('table#AllSelectedTest tbody tr:first td:last')
;
});
$(document).ready(function() {
$("table#AllSelectedTest tbody tr input").live({
click: function(){
$(this).closest('tr').remove();
}
})
});
I uses The above code For Generating a button and bind it with the events.
My Problem is some button works and some are not
its always good to give an id to element. try changing the code as below
fiddle example : http://jsfiddle.net/vSUYj/1/
also if you are using jquery above 1.7, please make use
oninstead oflive.update: try this as well, in case above not working
fiddle example : http://jsfiddle.net/vSUYj/