Js event source window. event. srcElement compatibility (detailed description) is as follows:
One advantage is that I want some objects in the body (or other elements) to respond to events without having to write them one by one on the outer layer and then check the event. srcElement. whether the tagName or other attributes are what you want to determine whether to respond to the event. but it seems like event. srcElement does not work in ff
For example
Span
P
Event object refers to the currently triggered event object, and window. event. srcElement refers to the object that triggers the event. For example, you set document. onclick = myfunc; at this time, all the page Click events are handed over to myfunc for processing. In the myfunc function, you can write vSrc = window. event. srcElement, know where the user clicked, and perform corresponding processing. Add the following section to an HTML file:
<Script Ange = "javascript"> document. onclick = myfunc; script