One good thing is that I want some object in the body (or other element) to respond to events without asked to write as long as the outer layer writes a Then check that event.srcElement.tagName or other attributes are not what you want to decide whether to respond to events or not. But it's like event.srcelement doesn't work in ff.</p><p> such as </p><p><input value= "input" ><br><span>span</span></ The P><div>div</div><p>event object refers to the event object that is currently triggered, and window.event.srcElement refers to the object that triggered the event. For example you set document.onclick = MyFunc;
At this point all the page click events are given to myfunc processing, in the MyFunc function can write VSRC =window.event.srcElement, know the user is clicked what place, do the corresponding processing. You find an HTML file that adds this paragraph:</p><p><textarea rows= "Ten" cols= "All" > <script Languange = "JavaScript" >Document.onclick=MyFunc; functionMyFunc () {alert (window.event.srcElement.tagName); } </script> </textarea> <script Languange = "JavaScript" >Document.onclick=MyFunc; functionMyFunc () {alert (window.event.srcElement.tagName); } </script></p><p> I'll see if I try. <a href=#>void(0) is a function that does nothing. </a></p></body> JS Event Source Window.event.srcElement