JAVAEOC
05-02-2004, 05:11 PM
How can I get the number of total amounts of objects in my document???
thanks
thanks
|
||||
Total amount of nodes in a documentJAVAEOC 05-02-2004, 05:11 PM How can I get the number of total amounts of objects in my document??? thanks nolachrymose 05-02-2004, 06:45 PM By "total amount of nodes," do you mean *all* nodes (attribute notes, comments, etc.), or do you really mean "total amount of elements," or something different? Also, out of curiosity: what is the purpose of finding the number of nodes in the document? Happy coding! :) jkd 05-02-2004, 07:21 PM You can get all element nodes via document.getElementsByTagName("*"). If you want all nodes, a DOM2 NodeIterator is what you'd want to use ideally, though no browser supports it. A recursive call pushing nodes onto a stack would achieve the same thing though. JAVAEOC 05-02-2004, 07:26 PM yea, I need the * , cuz I want to find all elements and assign them A ID if they dont have one laready :D squirellplaying 05-02-2004, 11:45 PM What is a node? Antoniohawk 05-02-2004, 11:50 PM Already been covered: [http://www.codingforums.com/showthread.php?t=36898] |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum