I have an anchor with a href tag of javascript:someFunc(). How can I get the tag that called the javascript code? in the onclick attribute i know you can pass this, but this references the DOMWindow when called from the href tag. I HAVE to use the href tag as the code i’m working with limits me to using it only. Anyone have an idea on what I can do?
I have an anchor with a href tag of javascript:someFunc() . How can I
Share
You can’t do that. The only way you can reference to the href is this:
<a href="# OR SOME VALID URL" onclick="YOURFUCNTION(this);"> Click Here </a>