Loop id from #nav links
2 answers
You can use an XPath expression to get a collection containing all the interesting nodes.
document.evaluate("//div[@id='nav']/a", document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null)
The above code will return a set containing all a elements that are children of the div element that has a nav id.
Here's a working example: http://jsfiddle.net/vycMP/3/
You can read more about XPath here: http://www.w3schools.com/xpath/default.asp
+1
a source to share