HTML DOM rowIndex Property
Complete TableRow Object Reference
Definition and Usage
The rowIndex property returns the position of a row in the table's rows
collection.
Syntax
Example
The following example returns the position of a row in the table's rows
collection:
<html>
<head>
<script type="text/javascript">
function alertRowIndex()
{
alert(document.getElementById("tr1").rowIndex);
}
</script>
</head>
<body>
<table border="1">
<tr id="tr1">
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr id="tr2">
<td>Peter</td>
<td>Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick="alertRowIndex()"
value="Alert row index" />
</body>
</html>
|
Try-It-Yourself Demos
Return the row index according to the table's row collection
Complete TableRow Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|