I am trying to address a value on a page using DOM.
Firefox DOM Inspector shows the following:
-DIV (ID=my_id)
--TABLE
---TBODY
----TR
----TR
-----TD
------TEXT (DATA=25)
With this, I thought that the following would get the value (i.e. 25):
It works with IE, but not with Firefox. In fact, Firefox gives a "no properties" error for the following:Code:document.getElementById("my_id").getElementsByTagName('tr')[1].firstChild.firstChild.data
Can anyone shed some light? ThanksCode:alert(document.getElementById("my_id").firstChild.nodeType);


Reply With Quote
Bookmarks