NonDocumentTypeChildNode interface contains methods that are particular to 节点 objects that can have a parent, but not suitable for DocumentType .

NonDocumentTypeChildNode is a raw interface and no object of this type can be created; it is implemented by 元素 ,和 CharacterData 对象。

特性

There are no inherited properties.

NonDocumentTypeChildNode.previousElementSibling 只读
返回 元素 immediately prior to this node in its parent's children list, or null if there is no 元素 in the list prior to this node.
NonDocumentTypeChildNode.nextElementSibling 只读
返回 元素 immediately following this node in its parent's children list, or null if there is no 元素 in the list following this node.

方法

There are neither inherited nor specific methods.

规范

规范 状态 注释
DOM
The definition of 'NonDocumentTypeChildNode' in that specification.
实时标准 Splitted the ElementTraversal interface in ParentNode , ChildNode ,和 NonDocumentTypeChildNode previousElementSibling and nextElementSibling are now defined on the latter.
CharacterData and 元素 implemented the new interfaces.
Element Traversal Specification
The definition of 'ElementTraversal' in that specification.
过时 Added the initial definition of its properties to the ElementTraversal pure interface and use it on 元素 .

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
Basic support (on 元素 ) Chrome 1 Edge 12 Firefox 3.5 IE 9 Opera 10 Safari 4 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android 10.1 Safari iOS Yes Samsung Internet Android Yes
Support (on CharacterData ) Chrome 1 Edge ≤18 Firefox 25 IE No Opera 10 Safari 4 WebView Android Yes Chrome Android Yes Firefox Android 25 Opera Android 10.1 Safari iOS Yes Samsung Internet Android Yes
nextElementSibling Chrome 4 Edge 12
12
Before Edge 79, this property was only implemented for 元素 , not for CharacterData .
Firefox 3.5 IE 部分支持 9
部分支持 9
Only implemented for 元素 , not for CharacterData 。见 polyfill .
Opera 10 Safari 4 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android 10.1 Safari iOS Yes Samsung Internet Android Yes
previousElementSibling Chrome 4 Edge 12
12
Before Edge 79, this property was only implemented for 元素 , not for CharacterData .
Firefox 3.5 IE 部分支持 9
部分支持 9
Only implemented for 元素 , not for CharacterData 。见 polyfill .
Opera 10 Safari 4 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android 10.1 Safari iOS Yes Samsung Internet Android Yes

图例

完整支持

完整支持

部分支持

部分支持

不支持

不支持

见实现注意事项。

另请参阅

元数据

  • 最后修改: