五月综合缴情婷婷六月,色94色欧美sute亚洲线路二,日韩制服国产精品一区,色噜噜一区二区三区,香港三级午夜理伦三级三

您現(xiàn)在的位置: 365建站網(wǎng) > 建站教程 > JavaScript 教程 > HTML DOM cellIndex 屬性

HTML DOM cellIndex 屬性

此節(jié)有 234 人學(xué)習(xí)過     參與評論

定義和用法

cellIndex 屬性可返回一行的單元格集合中單元格的位置。

語法

tabledataObject.cellIndex

實例

下面的例子可返回兩個單元格的位置(cell index):

<html>
<head>
<script type="text/javascript">
function alertTd1()
  {
  alert(document.getElementById('td1').cellIndex);
  }
function alertTd2()
  {
  alert(document.getElementById('td2').cellIndex);
  }
</script>
</head>
<body>

<table border="1">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td id="td1">Peter</td>
<td id="td2">Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick="alertTd1()" 
value="Alert cell index of 'Peter'" />
<br />
<input type="button" onclick="alertTd2()" 
value="Alert cell index of 'Griffin'" />

</body>
</html>

如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答??! 點擊進入論壇

發(fā)表評論 (234人查看0條評論)
請自覺遵守互聯(lián)網(wǎng)相關(guān)的政策法規(guī),嚴(yán)禁發(fā)布色情、暴力、反動的言論。
昵稱:
最新評論
------分隔線----------------------------
JavaScript 教程目錄

其它欄目

· 建站教程
· 365學(xué)習(xí)

業(yè)務(wù)咨詢

· 技術(shù)支持
· 服務(wù)時間:9:00-18:00
365建站網(wǎng)二維碼

Powered by 365建站網(wǎng) RSS地圖 HTML地圖

copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號