I\'m writing a GreaseMonkey script where I\'m iterating through a bunch of elements. For each element, I need a string ID that I can use to reference that element later. The
If you're not modifying the DOM you can get them all by indexed order:
(Prototype example)
myNodes = document.body.descendants() alert(document.body.descendants()[1].innerHTML)
You could loop through all of the nodes and give them a unique className that you could later select easily.