#1
  1. a lazy guy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Location
    Hong Kong
    Posts
    99
    Rep Power
    14

    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>
  2. #2
  3. a lazy guy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Location
    Hong Kong
    Posts
    99
    Rep Power
    14

    problem solved


    the above problem is solved by using ".id" instead of ".ID".

IMN logo majestic logo threadwatch logo seochat tools logo