Hello
I'm trying to display all DIV tags of a document :
Example :
+ <DIV id="1">
- <DIV id="1-1"></DIV>
</DIV>
+ <DIV id="2">
- <DIV id="2-1"></DIV>
+ <DIV id="2-2"></DIV>
- <DIV id="2-2-1"></DIV>
- <DIV id="2-2-2"></DIV>
etc...
I can retrieve all DIV using getElementsByTa gName, but I don't know how
deep they can be nested.
I have no idea how to store informations such as : does a div has children
? if yes, how many ? in turn do the children have children ? At what level
is each DIV ? etc
Only a recursive function could do that, I think
Any help appreciated
Thanks.
I'm trying to display all DIV tags of a document :
Example :
+ <DIV id="1">
- <DIV id="1-1"></DIV>
</DIV>
+ <DIV id="2">
- <DIV id="2-1"></DIV>
+ <DIV id="2-2"></DIV>
- <DIV id="2-2-1"></DIV>
- <DIV id="2-2-2"></DIV>
etc...
I can retrieve all DIV using getElementsByTa gName, but I don't know how
deep they can be nested.
I have no idea how to store informations such as : does a div has children
? if yes, how many ? in turn do the children have children ? At what level
is each DIV ? etc
Only a recursive function could do that, I think
Any help appreciated
Thanks.
Comment