You know the drill... say you have a list of links and corresponding divs. You want to show the div when the link is clicked -- so you want to get a reference to the div so you can hook an event up on the link.
When you're setting up your events, is it better to hook things up using unique ids like:
<a href="#" id="link123">Foo</a>
...
<div style="display: none;" id="div123"/>
or, to use some sort of parent.childnodes "relative path" to walk the DOM and get the proper reference to the div from the a?
Assume, for the purpose of this example, that the target div is a few levels removed in DOM from the link. Javascript libraries are totally kosher for this, YUI especially (but all are welcome).