IE8 和 Firefox 中的 event.toElement? [英] event.toElement in IE8 and Firefox?

查看:29
本文介绍了IE8 和 Firefox 中的 event.toElement?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在 Chrome 和 IE9 中,对于 onmouseout 事件,有一个 event.toElement 属性(因此您可以确定鼠标现在指向哪个元素).

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).

我在 Firefox 中找不到类似的属性.

I can not find a comparable property in Firefox.

很遗憾我不能使用 jQuery 来处理这些事件,我必须使用原生 js.

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

如有任何建议,我们将不胜感激.

Any advice would be appreciated.

推荐答案

你应该使用这个来代替 event.toElement:

Instead of event.toElement you should use this:

event.target

这篇关于IE8 和 Firefox 中的 event.toElement?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆