Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 5th, 2005, 02:50 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default reading table

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,



 
Old October 6th, 2005, 11:37 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi darkhalf,

This should get you started...
Code:
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






Similar Threads
Thread Thread Starter Forum Replies Last Post
reading from a table cell? Atomsk Access VBA 2 September 28th, 2006 07:46 AM
Reading a MS-Access table: PYee Javascript How-To 9 February 7th, 2005 08:12 AM
Reading a table harryinpa VBScript 3 December 30th, 2004 02:29 PM
(oracle 8i)Alter Table <table> coalesce partition combo Oracle 3 October 13th, 2004 09:35 AM
size of table (type table is table of number) MikoMax Oracle 1 November 19th, 2003 03:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.