I use a library which let me define href property on my links. But this lib don't allowed to define onclick property.
I want to execute JS function in my link. So I defined the following line (I know it's a bad practice, but I've no choice) :
<a href="javascript:get_element(this);return false;">Link</a>
With this line, the JavaScript function runs correctly. But I need to get the element that fired the link clicked and the preceding code gives me Window object. I know href property doesn't fire an event but I really need to get the link clicked.
With button tag it's very simple by using onclick="get_element(this)"
but with a tag I don't know how to do that.
If you want to try examples : https://jsfiddle.net/j8o7qvz2/
Do you have a solution ?
<a onclick="get_element(this);">Link</a>
? – Andy Oct 11 '18 at 10:11