I am having a specific problem with the JS event “onclick” and how it works in a very specific case. I have a set of nested DIVs that looks like this (somewhat):
In code:
<div id="A" ...>
<div id="B" ...> </div>
<div id="C" ...> </div>
</div>
The exact position of the DIVs are arbitrary, just know that there are nested DIVs.
DIV A has an onclick event attached to it.
When a user clicks on the divs I intend for the srcElement to without exception be div A.
Or maybe I’m just not using the right property.
Basically I want to be able to get the name of the div whose onclick event was called.
from inside the onclick function
If the
onclickis onA, thenthisin the handler will represent that element.