Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

event.toElement in IE8 and Firefox?

I have noticed that in Chrome and IE9, for onmouseout events there is an event.toElement property (so you can determine which element the mouse is now pointing at).

I can not find a comparable property in Firefox.

Unfortunately I can not use jQuery to handle these events, I have to use native js.

Any advice would be appreciated.

like image 311
captainclam Avatar asked Dec 22 '11 06:12

captainclam


2 Answers

Instead of event.toElement you should use this:

event.target 
like image 88
Azam Alvi Avatar answered Oct 08 '22 11:10

Azam Alvi


In Firefox it is event.relatedTarget https://developer.mozilla.org/en/DOM:event.relatedTarget#1003983

like image 38
captainclam Avatar answered Oct 08 '22 11:10

captainclam