I have code that looks like this:
<a href="someline">
<img src="img.jpg"/>
</a>
I have code all over my page, to get the links, and get their href like this:
e.target.href
The problem is, when clicking the link that contains the image, then e.target is the image itself not the anchor tag. I tried setting the href on the image as a bad solution, but e.target.href is undefined on the image.
How do I solve it so that e.target will reference the <a>
not the image.