--- title: ChildNode slug: Web/API/ChildNode tags: - API - DOM - Experimental - Interface - NeedsTranslation - Node - TopicStub translation_of: Web/API/ChildNode ---
The ChildNode
interface contains methods that are particular to {{domxref("Node")}} objects that can have a parent.
ChildNode
is a raw interface and no object of this type can be created; it is implemented by {{domxref("Element")}}, {{domxref("DocumentType")}}, and {{domxref("CharacterData")}} objects.
There are neither inherited, nor specific properties.
There are no inherited methods.
ChildNode
from the children list of its parent.ChildNode
's parent, just before this ChildNode
. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.ChildNode
's parent, just after this ChildNode
. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.ChildNode
in the children list of its parent with a set of {{domxref("Node")}} or {{domxref("DOMString")}} objects. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.Specification | Status | Comment |
---|---|---|
{{SpecName('DOM WHATWG', '#interface-childnode', 'ChildNode')}} | {{Spec2('DOM WHATWG')}} | Split the ElementTraversal interface in {{domxref("ParentNode")}} and ChildNode . previousElementSibling and nextElementSibling are now defined on the latter. The {{domxref("CharacterData")}} and {{domxref("DocumentType")}} implemented the new interfaces. Added the remove() , before() , after() and replaceWith() methods. |
{{SpecName('Element Traversal', '#interface-elementTraversal', 'ElementTraversal')}} | {{Spec2('Element Traversal')}} | Added the initial definition of its properties to the ElementTraversal pure interface and use it on {{domxref("Element")}}. |
External on github: childNode.js
{{ CompatibilityTable }}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support (on {{domxref("Element")}}) | {{CompatChrome(1.0)}} | {{CompatVersionUnknown}} | {{CompatGeckoDesktop(23)}} | 9.0 | 10.0 | 4.0 |
Support on {{domxref("DocumentType")}} and {{domxref("CharacterData")}} {{experimental_inline}} | {{CompatChrome(23.0)}} | {{CompatNo}} | {{CompatGeckoDesktop(23)}} | {{CompatNo}} | 16.0 | {{CompatNo}} |
remove() {{experimental_inline}} |
{{CompatChrome(29.0)}} | {{CompatVersionUnknown}} | {{CompatGeckoDesktop(23)}} | {{CompatNo}} | 16.0 | {{CompatNo}} |
before() , after() , and replaceWith() {{experimental_inline}} |
{{CompatChrome(54.0)}} | {{CompatNo}} | {{CompatGeckoDesktop(49)}} | {{CompatNo}} | {{CompatOpera(39)}} | {{CompatNo}} |
Feature | Android | Android Webview | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support (on {{domxref("Element")}}) | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile(23)}} | {{CompatVersionUnknown}} | 10.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Support on {{domxref("DocumentType")}} and {{domxref("CharacterData")}} {{experimental_inline}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatNo}} | {{CompatGeckoMobile(23)}} | {{CompatNo}} | 16.0 | {{CompatNo}} | {{CompatVersionUnknown}} |
remove() {{experimental_inline}} |
{{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile(23)}} | {{CompatNo}} | 16.0 | {{CompatNo}} | {{CompatVersionUnknown}} |
before() , after() , and replaceWith() {{experimental_inline}} |
{{CompatNo}} | {{CompatChrome(54.0)}} | {{CompatNo}} | {{CompatGeckoMobile(49)}} | {{CompatNo}} | {{CompatOperaMobile(39)}} | {{CompatNo}} | {{CompatChrome(54.0)}} |