parentElement 获取对象层次中的父对象。
parentNode 获取文档层次中的父对象。
childNodes 获取作为指定对象直接后代的 HTML 元素和 TextNode 对象的集合。
children 获取作为对象直接后代的 DHTML 对象的集合。
parentNode 获取文档层次中的父对象。
childNodes 获取作为指定对象直接后代的 HTML 元素和 TextNode 对象的集合。
children 获取作为对象直接后代的 DHTML 对象的集合。
解决方案 »
- 网页嵌入百度地图查询两地之间的距离。获取公里数
- 帮忙看下左右滚动的 .哪里计算错了啊?
- 关于showModalDialog的问题?
- js让表格大小随意变动
- 小妹碰到个问题一上午没解决,高手来帮忙啊,感谢:在进入页面时我想触发一个javasript,具体的进来看,谢谢在线急!
- 怎样做一个可以像browser一样选文件的button?(在线等待)
- 怎样用js写一个终止程序,类似asp的response.end
- 怎样检查一个<input>或者一个<textarea>里面的文字的长度呢?
- 如何实现:当打开一个页面时,如何让一个隐藏的层(装着小图片)显示在页面某一位置(该位置坐是动态变化的),当鼠标移动到该层时,该层
- 怎么样用OnClick来把一个List里选的值加在另一个List里?
- 请教各位:如何让层漂浮在框架页面上?
- 如果原来iframe里面已经有内容,需要对这些内容进行编辑,为了不把原来的内容冲掉,应该怎样设置iframe里的属性?
那么,他们的标准版就是parentNode,childNodes。
这两个的作用和parentElement、children是一样的,并且是标准的、通用的。
parentNode Property: Retrieves the parent object in the document hierarchy.
parentElement Property:Retrieves the parent object in the object hierarchy.childNodes:
Retrieves a collection of HTML Elements and TextNode objects that are direct descendants of the specified object.children:
Retrieves a collection of DHTML Objects that are direct descendants of the object.
parentElement children:
There is no public standard that applies to this property/collection.
parentNode childNodes:
This property/collection is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .很多W3C标准从IE5才开始支持
IE4以前的只能用ie自己的方法
是W3C太晚,还是microsoft问题,哪位牛人有空解答一下吧