<html>
<body>
<input type="button" value="add row" id="addrow"/>
<table>
<tr>
<td width="20"><input type="checkbox" /><td>
<td>dddddddd</td>
</tr>
</table>
</body>
<script type="text/javascript" src="jquery-1.5.1.min.js"></script>
<script type="text/javascript" >
$(document).ready(function(){
$('input[type="checkbox"]').live('click',function(){//live给新添加的节点添加事件
$(this).parent().parent().remove();
});
$('addrow').mouseover(function(){
$(this).css('color','red');
});
$('addrow').mouseout(function(){
$(this).css('color','red');
});
$('#addrow').click(function(){
var tr = $('<tr>');
var td1 = $('<td>');
td1.attr('width','20');
var input = $('<input>');
input.attr('type','checkbox');
var td2 = $('<td>');
td2.text('aaaa');
td1.append(input);
tr.append(td1);
tr.append(td2);
//$('table').append(tr);
$('tbody tr:first').before(tr);
});
});
</script>
</html>