w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: HTML DOM cells ¼¯ºÏ
The cells collection returns an array containing each cell in a table.
cells¼¯ºÏ¿É·µ»Ø°üº¬±í¸ñÖÐÿ¸öµ¥ÔªµÄÊý×é
tableObject.cells[] |
<html>
<head>
<script type="text/javascript">
function cell()
{
var x=document.getElementById('myTable').cells
alert(x[0].innerHTML)
}
</script>
</head>
<body> <table id="myTable" border="1"> <tr> <td>cell 1</td> <td>cell 2</td> </tr> <tr> <td>cell 3</td> <td>cell 4</td> </tr> </table> <form> <input type="button" onclick="cell()" value="Alert first cell"> </form> </body> </html> |
InnerHTML of a cell
ÍùÒ»¸öcellÀïinnerHTML
ÆÀÂÛ (0)
All