ie8_getElementById()

发布于 2024-09-10 14:48:52 字数 73 浏览 1 评论 0原文

document.getElementById() 和 document.ie8_getElementById() 之间有什么区别。

Whats the difference between document.getElementById() and document.ie8_getElementById().

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

压抑⊿情绪 2024-09-17 14:48:52

来自 MSDN:
在 IE8 模式下,getElementById 仅对 ID 属性执行区分大小写的匹配。在 IE7 模式和以前的模式中,此方法对 ID 和 NAME 属性执行不区分大小写的匹配。

换句话说,它的工作方式就像世界其他地方在 ie8 模式下一样。您应该始终调用 getElementById,它只是在不同版本的 ie 中工作方式不同。

From MSDN:
In IE8 mode, getElementById performs a case-sensitive match on the ID attribute only. In IE7 mode and previous modes, this method performs a case-insensitive match on both the ID and NAME attributes.

In other words, it works like the rest of the world in ie8 mode. You should always call getElementById, it just works differently in different versions of ie.

北城孤痞 2024-09-17 14:48:52

IE8模式下,getElementById执行
ID 上区分大小写的匹配
仅属性。在 IE7 模式下和
以前的模式,此方法执行
两个 ID 的匹配不区分大小写
和 NAME 属性,这可能
产生意想不到的结果。

http://msdn.microsoft.com/en-我们/库/ms536437%28VS.85%29.aspx

IE8 mode, getElementById performs a
case-sensitive match on the ID
attribute only. In IE7 mode and
previous modes, this method performs a
case-insensitive match on both the ID
and NAME attributes, which might
produce unexpected results.

http://msdn.microsoft.com/en-us/library/ms536437%28VS.85%29.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文