No replies
seb
Offline
Enthusiast
Last seen: 14 years 6 days ago
Joined: 2003-09-20
Posts: 208
Points: 0

I've got a problem: calling a js function with one of the arguments as "this".

Code works fine if I call it from an onclick event, but if I do href="javascript:blah..." instead, "this" does not contain a reference to the <a> tag.

My best guess is that I've generated a reference to the href attribute of the <a> tag. How do I reach the tag element from that?

I appreciate that using the onclick event with a "return false;" and "href="#"" is probably a better way of doing this anyway, but I'd like to know the answer nonetheless!

cheers

Tags: