<div class="codetitle"> <span><a style="CURSOR: pointer" data="78829" class="copybut" id="copybut78829" onclick="doCopy('code78829')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code78829"> <br><html> <br><머리> <br><제목> <br></title> <br><script src="js/jquery-1.4.2_min.js" type="text/javascript"></script> <br><script type="text/javascript" 언어="javascript"> <br>var row_count = 0; <br>function addNew() <br>{ <br>var table1 = $('#table1'); <br>var firstTr = table1.find('tbody>tr:first'); <br>var row = $("<tr></tr>"); <br>var td = $("<td></td>"); <br>td.append($("<input type='checkbox' name='count' value='New'><b>CheckBox" row_count "</b>") <br>); <br>row.append(td); <br>table1.append(row); <br>행_개수; <br>} <br>function del() <br>{ <br>var selected = $("input[type='checkbox'][name='count']"); <br>$(checked).each(function(){ <br>if($(this).attr("checked")==true) //주의: 此处判断不能用$(this).attr( "checked")=='true'来判断。 <br>{ <br>$(this).parent().parent().remove() <br>} <br>}); <br>} <br></script> <br></head> <br><본문> <br><input type="button" value="Add" onclick="addNew();"> <br><input type="button" value="Delete" onclick="del();"> <br><div id="rightcontent"> <br><table id="table1" cellpacing="3" cellpadding="3" border="1"> <br><tbody> <br><tr> <br><일> <br>새 행을 추가한 다음 삭제 기능을 테스트하세요. <br></일> <br></tr> <br></tbody> <br></테이블> <br></div> <br></body> <br></html><br> </div>