[Javascript] Code optimization

Terry Riegel riegel at clearimageonline.com
Mon Aug 7 17:05:01 CDT 2006


this.parentNode doesnt seem to work for me. and it seems to me the  
getElementById solution is not relatively addressed, but rather  
absolute as in my example. Could you provide an example that work for  
you that I could test.


<html>
<div class="nor" id="otherstuff">
<a href="#" >Test</A>
<a href="javascript:alert(this.parentNode)" class="DIR">otherstuff</a>
</div>
</html>

The above code does not work for me in Safari. The alert returns  
UNDEFINED.

Thanks,



On Aug 7, 2006, at 5:41 PM, Peter Brunone wrote:

> this.parentNode would work, or
> document.getElementById('otherstuff')
> should do the same.




More information about the Javascript mailing list