I use the following attribute on a page to return the inner element clicked in a certain div.
onclick="alert(event.target.innerHTML)";
It properly returns the name if I click on a heading element, but it returns nothing if clicked on an image element.
How can I return the alt name of the image clicked?
Heading element:
Image element:
1