NonDocumentTypeChildNode

NonDocumentTypeChildNode 接口包含专属于某些(特殊) Node 对象的方法,这些对象可以拥有父对象,但不适用于 DocumentType 接口。

NonDocumentTypeChildNode 是一个裸接口(raw interface),无法创建拥有此类型的对象;它是由 Element,和 CharacterData 对象实现的。

属性

此接口没有继承属性。

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

方法

此接口既没有继承方法,又没有专有方法。

规范

规范 状态 备注
DOM
NonDocumentTypeChildNode
Living Standard Splitted the ElementTraversal interface in ParentNode, ChildNode, and NonDocumentTypeChildNode. The previousElementSibling and nextElementSibling are now defined on the latter.
The CharacterData and Element implemented the new interfaces.
Element Traversal Specification
ElementTraversal
Obsolete Added the initial definition of its properties to the ElementTraversal pure interface and use it on Element.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support (on Element)Chrome Full support 1Edge Full support YesFirefox Full support 3.5IE Full support 9Opera Full support 10Safari Full support 4WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support YesSamsung Internet Android ?
Support (on CharacterData)Chrome Full support 1Edge Full support YesFirefox Full support 25IE No support NoOpera Full support 10Safari Full support 4WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 25Opera Android Full support 10.1Safari iOS Full support YesSamsung Internet Android ?
nextElementSiblingChrome Full support 4Edge Full support YesFirefox Full support 3.5IE Partial support 9
Notes
Partial support 9
Notes
Notes Only implemented for Element, not for CharacterData. See polyfill.
Opera Full support 10Safari Full support 4WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support YesSamsung Internet Android ?
previousElementSiblingChrome Full support 4Edge Full support YesFirefox Full support 3.5IE Partial support 9
Notes
Partial support 9
Notes
Notes Only implemented for Element, not for CharacterData. See polyfill.
Opera Full support 10Safari Full support 4WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Partial support  
Partial support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

参见