nodeIndex是IE中有效的DOM元素属性吗? [英] Is nodeIndex a valid DOM element property in IE?

查看:135
本文介绍了nodeIndex是IE中有效的DOM元素属性吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天在工作中遇到了一些javascript,使用 jQuery 来获取两个元素。然后使用elem.nodeIndex来确定每个元素的元素父元素中的位置。没有什么是在任何地方设置此属性,我现在看到在 msdn mdc 或其他任何地方。

I came across some javascript at work today that used jQuery to fetch two elements. It then used elem.nodeIndex to determine the position in the elements parent for each element. Nothing is setting this property anywhere and I do now see a reference to it in the msdn, mdc, or anywhere else.

我在 FireFox 中使用 FireBug 和测试了铬和歌剧中的代码。我确定没有什么是试图设置这个属性。但是,我找不到这个nodeIndex属性的任何信息。

I stepped through this javascript in FireFox with FireBug and tested the code in chrome and opera. I am sure nothing was trying to set this property. However, I can't find any information on this nodeIndex property anywhere.

在IE中,nodeIndex是否作为DOM属性存在,或者在调试我的代码时是否想念某事?

Does nodeIndex exist as a DOM property in IE, or did I miss something while debugging my code?

更新:我在 jQuery list ,他们确认该属性仅供内部使用:

UPDATE: I asked the same question on the jQuery list and they confirmed the property is for internal use only.:

推荐答案

看起来它的jQuery是在某些情况下将 nodeIndex 添加到节点

It looks like it's jQuery that's adding nodeIndex to nodes in some cases.

这篇关于nodeIndex是IE中有效的DOM元素属性吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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