Skip to content
Advertisement

event.target on Firefox

JavaScript

Works fine on Google Chrome and IE but not on Firefox. Tried it on Google. Google says event.srcElement (works on IE but not on Firefox) so I have added event.target but still not working. Is there anymore changes I need to do to work on Firefox? By the way I’m using 3.5 version of Firefox.

JavaScript

Please help me to make it work on Firefox

Advertisement

Answer

Make sure you define event as a formal parameter to the handler.

IE defines it globally, and Chrome defines it both in both places, so it works either way, but Firefox only defines it as a function parameter.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement