ChildNode
mixin contains methods and properties that are common to all types of
节点
objects that can have a parent.
It's implemented by
元素
,
DocumentType
,和
CharacterData
对象。
There are neither inherited, nor specific properties.
There are no inherited methods.
ChildNode.remove()
ChildNode
从
children
list of its parent.
ChildNode.before()
节点
or
DOMString
objects in the
children
list of this
ChildNode
's parent, just before this
ChildNode
.
DOMString
objects are inserted as equivalent
文本
节点。
ChildNode.after()
节点
or
DOMString
objects in the
children
list of this
ChildNode
's parent, just after this
ChildNode
.
DOMString
objects are inserted as equivalent
文本
节点。
ChildNode.replaceWith()
ChildNode
在
children
list of its parent with a set of
节点
or
DOMString
对象。
DOMString
objects are inserted as equivalent
文本
节点。
| 规范 | 状态 | 注释 |
|---|---|---|
|
DOM
The definition of 'ChildNode' in that specification. |
实时标准 |
Split the
ElementTraversal
interface in
ParentNode
and
ChildNode
.
previousElementSibling
and
nextElementSibling
are now defined on the latter. The
CharacterData
and
DocumentType
implemented the new interfaces. Added the
remove()
,
before()
,
after()
and
replaceWith()
方法。
|
|
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
元素
.
|
External on GitHub:
childNode.js
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
ChildNode
|
Chrome 1 | Edge 12 | Firefox 23 | IE 9 | Opera 10 | Safari 4 | WebView Android Yes | Chrome Android Yes | Firefox Android 23 | Opera Android 10.1 | Safari iOS Yes | Samsung Internet Android Yes |
after
|
Chrome 54 | Edge 17 | Firefox 49 | IE No | Opera 39 | Safari 10 | WebView Android 54 | Chrome Android 54 | Firefox Android 49 | Opera Android 41 | Safari iOS 10 | Samsung Internet Android 6.0 |
before
|
Chrome 54 | Edge 17 | Firefox 49 | IE No | Opera 39 | Safari 10 | WebView Android 54 | Chrome Android 54 | Firefox Android 49 | Opera Android 41 | Safari iOS 10 | Samsung Internet Android 6.0 |
remove
|
Chrome 23 | Edge 12 | Firefox 23 | IE No | Opera 15 | Safari 7 | WebView Android ≤37 | Chrome Android 25 | Firefox Android 23 | Opera Android 14 | Safari iOS 7 | Samsung Internet Android 1.5 |
replaceWith
|
Chrome 54 | Edge 17 | Firefox 49 | IE No | Opera 39 | Safari Yes | WebView Android 54 | Chrome Android 54 | Firefox Android 49 | Opera Android 41 | Safari iOS Yes | Samsung Internet Android 6.0 |
完整支持
不支持
实验。期望将来行为有所改变。
ParentNode
interface
ParentNode
interface
NonDocumentTypeChildNode
interface
ChildNode
AbortController
AbortSignal
AbstractRange
Attr
ByteString
CDATASection
CSSPrimitiveValue
CSSValue
CSSValueList
CharacterData
注释
CustomEvent
DOMConfiguration
DOMError
DOMErrorHandler
DOMException
DOMImplementation
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMParser
DOMPoint
DOMPointInit
DOMPointReadOnly
DOMRect
DOMString
DOMTimeStamp
DOMTokenList
DOMUserData
Document
DocumentFragment
DocumentType
元素
ElementTraversal
Entity
EntityReference
事件
EventTarget
HTMLCollection
MutationObserver
节点
NodeFilter
NodeIterator
NodeList
NonDocumentTypeChildNode
ProcessingInstruction
PromiseResolver
范围
StaticRange
文本
TextDecoder
TextEncoder
TimeRanges
TreeWalker
TypeInfo
USVString
UserDataHandler
XMLDocument