I have about thousand DIV tags structured this way:
<div id='1'> <div class='1'></div> <div class='2'></div> ... </div> <div id='2'> <div class='1'></div> <div class='2'></div> ... </div>
If I want to now access a particular node, say ‘div#10 div.5′ – what is the fastest way to do it using javascript DOM traversal? I already have the index values ’10’ and ‘5’ – I am just looking for the fastest way to achieve this.
Thanks a lot.
Without validation and assuming the child nodes are the only nodes and all in sequence;
Watch out for whitespace that becomes a node https://developer.mozilla.org/En/Whitespace_in_the_DOM