[thelist] DOM: Counting node of type 1?

Saila, Craig Craig.Saila at bgminteractive.com
Wed Mar 5 09:32:00 CST 2003


Frank wrote:
> I have a div containing id'd spans, indented by a tab. Moz
> counts the tabs as a text node (which I suppose is correct).

More on this, and a workaround:
<http://www.mozilla.org/docs/dom/technote/whitespace/>

> How can I go about identifying only my spans?

If your DIV has an ID:
 nObj = documentGetElementById("id")
 spanObjs = nObj.documentGetElementsByTagName("span")
"spanObjs" will then contain an array of all the SPANs within the
particular DIV.

Will this work for you?

--
Cheers,

Craig Saila
------------------------------------------
craig at saila.com : http://www.saila.com/
------------------------------------------



More information about the thelist mailing list