Re: window.event and Event.srcElement

On 3/25/13 10:17 AM, Dave Methvin wrote:
> What content depends on them

Most typically, content that does this sort of thing:

   <script>
     function something() {
       alert(event.target);
     }
   </script>
   <div onclick="something()">Click me</div>

but also content that does this:

   <svg><rect onclick="alert(event.target);"></rect></svg>

A brief look at stackoverflow will show that this is something authors 
run into a lot.  And that's just the ones that are bothering to test in 
multiple browsers.

If you want specific site examples www.ocn.ne.jp (on "mobile" only, 
natch, thanks to only testing in WebKit) is the most recent one I came 
across.

> and why cater to such code?

Because otherwise users get broken websites.

-Boris

Received on Monday, 25 March 2013 14:30:02 UTC