
February 10th, 2002, 09:17 PM
|
 |
a lazy guy
|
|
Join Date: Aug 2001
Location: Hong Kong
Posts: 99
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
|
Javascript: checking a table cell ID
Hello,
I wrote the following codes to check whether a table cell has a ID 'D1', but it doesnt work. ANyone got a solution?
<script>
function test()
{
var oRow;
var curr_row, curr_cell;
for (curr_row = 0; curr_row < oTable.rows.length; curr_row++)
{
oRow = oTable.rows[curr_row];
for (curr_cell = 0; curr_cell < oRow.cells.length; curr_cell++)
{
if (oRow.cells[curr_cell].ID == "D1")
alert('found');
}
}
}
<script>
<table ID="oTable">
<tr>
<td ID="D1">cell 1</td>
</tr>
</table>
|