久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jquery怎么清空表格除前兩行內(nèi)容

      jquery清空表格除前兩行內(nèi)容的方法:1、使用“$("tr:first").empty();”語(yǔ)句選中表格第一行并清空該行內(nèi)容;2、使用“$("tr:nth-child(2)").empty();”語(yǔ)句選中表格第二行并清空該行內(nèi)容。

      jquery怎么清空表格除前兩行內(nèi)容

      本教程操作環(huán)境:windows7系統(tǒng)、jquery1.10.2版本、Dell G3電腦。

      jquery清空表格除前兩行內(nèi)容

      實(shí)現(xiàn)方法:

      • 利用:first選擇器選中表格第一行,并使用empty()清空內(nèi)容

      • 利用:nth-child(2)選擇器選中表格第二行,并使用empty()清空內(nèi)容

      說(shuō)明:empty()方法可移除被選元素的所有子節(jié)點(diǎn)和內(nèi)容。

      實(shí)現(xiàn)代碼:

      <!DOCTYPE html> <html> 	<head> 		<meta charset="utf-8"> 		<script src="js/jquery-1.10.2.min.js"></script> 		<script> 			$(document).ready(function() { 				$("button").on("click", function() { 					$("tr:first").empty(); //清空表格第一行內(nèi)容 					$("tr:nth-child(2)").empty(); //清空表格第二行內(nèi)容 				}); 			}); 		</script> 	</head>  	<body class="ancestors"> 		<table border="1"> 			<tr> 				<th>商品</th> 				<th>價(jià)格</th> 			</tr> 			<tr> 				<td>T恤</td> 				<td>¥100</td> 			</tr> 			<tr> 				<td>牛仔褂</td> 				<td>¥250</td> 			</tr> 			<tr> 				<td>牛仔庫(kù)</td> 				<td>¥150</td> 			</tr> 		</table><br> 		<button>清空表格除前兩行內(nèi)容</button> 	</body>  </html>

      jquery怎么清空表格除前兩行內(nèi)容

      【推薦學(xué)習(xí):jQuery視頻教程、web前端視頻】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)