Subject: reading table
Posted By: darkhalf Post Date: 10/5/2005 2:50:55 PM
Hi,

Say I have 2 tables, which don't have any identifier.  How could I get the innerHTML value of the first <td> in the first <tr>?  I'm tottaly lost in the document.all...

Thank you,



Reply By: ChrisScott Reply Date: 10/6/2005 11:37:49 AM
Hi darkhalf,

This should get you started...

var tables = document.getElementsByTagName("table");
if(tables.length != 0){
    var table = tables.item(0);
    var cells = table.getElementsByTagName("td");
    if(cells.length != 0){
        alert(cells.item(0).innerHTML);
    } 
}

HTH,

Chris


Go to topic 35452

Return to index page 458
Return to index page 457
Return to index page 456
Return to index page 455
Return to index page 454
Return to index page 453
Return to index page 452
Return to index page 451
Return to index page 450
Return to index page 449