[BNM] ***AMENDMENT*** How do you create and array of textNode.data of all TD's on a page
David Andrew
david.andrew at gmail.com
Tue Oct 14 21:11:48 BST 2008
Clear as a bell
Thanks Andy
2008/10/14 Andy Smith <andy.bnm at zambezi.org.uk>:
> 2008/10/14 David Andrew <david.andrew at gmail.com>:
>> I have a set of tables on a page and I want to make an array of the
>> child textNodes.data of each TD.
>>
>> Can it be done?
>>
>> So far I have managed to greate an array of TD's but the only property
>> I can associate with [HTMLCollection] is .length, I can't reference the
>> texNodes associated with them!?!
>
> If your HTMLCollection is called 'collection' then 'collection.length'
> is the number of TD elements and 'collection[0]', 'collection[1]', etc
> refer to the individual elements. If all the TDs only contain text, no
> child elements, then the only child node of each TD will be a text
> node that you can access with 'collection[0].firstChild' etc, and you
> can get the text content with 'collection[0].firstChild.nodeValue'
> etc.
>
> Andy
> --
>
> BNM Subscribe/Unsubscribe:
> http://www.brightonnewmedia.org/options/bnmlist
>
> BNM powered by Wessex Networks:
> http://www.wessexnetworks.com
>
More information about the BNMlist
mailing list. Powered by Wessex Networks