event.toElement in IE8 and Firefox?
I met a issue when I use Jay's answer, event.target
on firefox points to the parent element of event.toElement
's target on chrome.
After looking into the event obj, I find event.originalEvent.target
, it works good on both firefox and chrome.
In Firefox it is event.relatedTarget
https://developer.mozilla.org/en/DOM:event.relatedTarget#1003983
Instead of event.toElement you should use this:
event.target