HTML DOM id Property
Complete TableCell Object Reference
Definition and Usage
The id property sets or returns the id of a table cell.
Syntax
Example
The following example returns the id of a table cell:
<html>
<head>
<script type="text/javascript">
function alertId()
{
alert(document.getElementById("td1").id);
}
</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=alertId() value="Alert ID" />
</body>
</html>
|
Try-It-Yourself Demos
Get the
id of a table cell
Complete TableCell Object Reference
Want To Be A Web Master?
If you want to be a Web Master, you will have to host your web site with an ISP (Internet Service Provider).
MaximumASP offers seven different configurations of dedicated servers to meet your Windows and .NET hosting needs.
Hosted on our multi-tiered Enterprise Class network, these servers provide the performance, security and reliability
you need to host your high end web sites and applications.
Visit MaximumASP
|