HTML DOM id Property
Complete Table Object Reference
Definition and Usage
The idr property sets or returns the id of a table.
Syntax
Example
<html>
<head>
<script type="text/javascript">
function alertId()
{
alert(document.getElementById("table1").id);
}
</script>
</head>
<body>
<table id="table1" border="1">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick=alertId()
value="Alert id of table" />
</body>
</html>
|
Try-It-Yourself Demos
Alert the
id of a table
Complete Table Object Reference
|