How to send a click event (JS or JQuery) to a parent object that is an anchor? My main HTML looks like this:
<a href="javascript:myFunc(1,2,3)"> <img id="btn1" src="myimg.png"> </a>
Therefore, I can easily reference the bind button via:
document.getElementById('btn1').parentNode
but
document.getElementById('btn1').parentNode.click
although it doesn't seem to cause a console error on firebug, the javascript function doesn't seem to work either. How to send a click on this thing. By the way, I have no control over HTML, so I canβt just declare the identifier of the attached tag.
source share