久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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怎么檢查一個(gè)表格有多少行

      jquery檢查一個(gè)表格有多少行的方法:1、使用“$("table").find("tr")”語(yǔ)句獲取到table表格中的tr對(duì)象;2、利用length屬性計(jì)算tr對(duì)象的長(zhǎng)度,即可獲取表格的行數(shù),語(yǔ)法“tr對(duì)象.length”。

      jquery怎么檢查一個(gè)表格有多少行

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

      在表格中,一個(gè)tr標(biāo)簽對(duì)就表示一行數(shù)據(jù)。想要使用jquery檢查一個(gè)表格有多少行,就需要檢查一個(gè)表格有多少個(gè)tr標(biāo)簽對(duì)。

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

      <!DOCTYPE html> <html> 	<head> 		<meta charset="utf-8" /> 		<script src="js/jquery-1.10.2.min.js"></script> 		<script type="text/javascript"> 			$(document).ready(function() { 				$("button").click(function() { 					var num=$("table").find("tr").length; 					alert(num); 				}); 			}); 		</script>  	</head> 	<body> 		<table border="1"> 			<caption>人物信息</caption> 			<tr> 				<th>姓名</th> 				<th>年齡</th> 			</tr> 			<tr> 				<td>Peter</td> 				<td>20</td> 			</tr> 			<tr> 				<td>Lois</td> 				<td>20</td> 			</tr> 		</table><br /> 		<button>獲取表格的行數(shù)</button> 	</body> </html>

      jquery怎么檢查一個(gè)表格有多少行

      相關(guān)教程推薦:jQuery視頻教程

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