If I want my images to execute on click events, and so on, I probably have a reason for that. If that thing looks and works horrible, I'll learn that, but it may also work perfectly, or in 99% nobody cares.
If I want my images to execute on click events, and so on, I probably have a reason for that. If that thing looks and works horrible, I'll learn that, but it may also work perfectly, or in 99% nobody cares.
There's a semantic way to accomplish that. If the click event you want to add triggers an action inside the page you can do
<button aria-title="Open modal">
<img src="/img/surprised-pikachu.jpg" alt="Surprised Pikachu meme">
</button>
Or if clicking in the image takes you to a different page, then <a href="#" aria-title="Visit the learn semantic HTML page">
<img src="/img/surprised-pikachu.jpg" alt="Surprised Pikachu meme">
</a>
Then you can add your click event to the surrounding element and add a few classes to remove the default stylings.... only eventually, a quick fix will have morphed into a destroyed engine.
Just because you can't see it doesn't mean it doesn't have an effect
It’s a bit strange to me that in my last position all these great JavaScript engineers were still using div’s for everything when there’s so much you can harness directly from the browser’s interpretation of these elements to give you a pleasant and consistent user experience for your clients.
Besides that, it makes trawling through your elements in your web inspectors a lot easier to read when you actually have lists, sections, headers, buttons, etc.