View Full Version : Reach the outer element?

12-10-2004, 10:00 AM
I am going to set li-element id to cuurent, could i reach the object and send it within "highlighttab(this, 'home')," Change this against the list object.

<li><a href="#" onClick="highlighttab(this, 'home')">Home</a></li>

When i do as in the above example i set the a-element to current. I want to do like the code below. This i thougt to do with javascript.

<li id="current"><a href="#" onClick="highlighttab(this, 'home')">Home</a></li>

Willy Duitt
12-10-2004, 10:31 AM
<li id="test"><a href="#" onclick="this.parentNode.id='current';alert(this.parentNode.id);return false">Home</a></li>