Basically is to click button to generate table row, then click minus button to remove row.
I have tried it with a few ways below, non of it work. -.bind -.live -normal way
It seems like it is not working due to the table is generated dynamically.
<script language="JavaScript" src="jquery-1.4.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var html = '';
var rows= 5;
var cols= 4;
$('#btnGenTable').bind("click", function() {
for (var r = 1; r <= rows; r++)
{
html += '<tr>';
for (var c = 1; c <= cols; c++)
{
cellText= "row " + r + " col " + c;
html += '<td>aa</td>';
}
html+= '<td><img class="delete" src="minus.jpg" /></td>';
html += '</tr>';
};
$('.inner').html('').append(html);
});
$('table tbody tr td img.delete').click(function(){
alert('clicked');
$(this).parent().parent().remove();
});
});
</script>
<br />
<table id="tblsize" class="inner" border="1" width="80%">
</table>
<input type=button value="Generate Table" name="btnGenTable" id="btnGenTable" class=text100>