Jquery 动态增加删除行

<script type="text/javascript" src="jquery-1.8.2.js"></script>
<table id="myTable">
</table>
<input type="button" id="newBtn" value="add"/>
<input type="button" id="delBtn" value="del"/>
<script>
$(document).ready(function() {
$("#newBtn").bind("click", function(){
//alert($("input:checked"));
$("#myTable").append("<tr><td><input id=\"sd\" type=\"checkbox\" /></td><td><input type=\"text\" /></td></tr>");
//alert(document.getElementById('sd').value);
});

$("#delBtn").bind("click", function(){
//alert($("input:checked"));
$("input:checked").parent().parent().remove();
});

});

</script>

原文地址:https://www.cnblogs.com/yangy608/p/2816774.html