This should be an easy one..
I've got a series of divs on my page that contains an image and text. Similar to a figure/figurecaption. I want to be able to add some sort of an event to the div so that whenever the div, or anything in it is pressed via a mouse click or a tap, the event
fires.
This is super easy if it's a button, and it's easy enough in C# / XAML. I'm trying to challenge myself with Html5.
I can already loop through the divs with a GetELementsByClass call. I'm getting the references to each div, but I'm not sure of the event name. Divs, ordinarily, don't have a click event, right? I tried adding the event handler of onClick,
onclick, click, etc. They don't appear to work.
What's the best way to accomplish what I need to do? Is there something I'm doing wrong?
-J