<!DOCTYPE html>
<html>
<head>
<title>test</title>
<script>
var table=document.getElementById("myTable");
for (var i = 0, i < table.rows.length; i++)
{
var one=(table.rows.cells[1].innerHTML);
document.write(one);
}
</script>
</head>
<body>
<table border="1" id="myTable">
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
<tr>
<td>g</td>
<td>h</td>
<td>i</td>
</tr>
</table>
</body>
</html>
this is just a test to see whether tables can be iterated through using this method, however no output is produced using the javascript code. can anyone suggest why? please thanks
<html>
<head>
<title>test</title>
<script>
var table=document.getElementById("myTable");
for (var i = 0, i < table.rows.length; i++)
{
var one=(table.rows.cells[1].innerHTML);
document.write(one);
}
</script>
</head>
<body>
<table border="1" id="myTable">
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
<tr>
<td>g</td>
<td>h</td>
<td>i</td>
</tr>
</table>
</body>
</html>
this is just a test to see whether tables can be iterated through using this method, however no output is produced using the javascript code. can anyone suggest why? please thanks