This article is in progress of being translated.
L'interface ChildNode contient des méthodes qui sont particulières aux objets Node qui peuvent avoir un parent.
ChildNode est une interface de flux et aucun object de ce type ne peut etre créer ; elle est implémentée par les objets Element, DocumentType, et CharacterData.
Propriétés
Il n'y à pas de propriétés héritées.
-
ChildNode.previousElementSiblingLecture seule -
Returns the
Elementimmediately prior to thisChildNodein its parent's children list, ornullif there is noElementin the list prior to thisChildNode. -
ChildNode.nextElementSiblingLecture seule -
Retourne l'
Elementsuivant immédiatement ceChildNodedans la liste des enfants du parent, ounullsi il n'y a pas d'Elementdans la liste suivant cChildNode.
Méthodes
Il n'y a pas de méthodes héritées.
-
ChildNode.remove() -
Supprime ce
ChildNodede la liste des enfants du parent. -
ChildNode.before() -
ajoute un jeu d'objet
NodeouDOMStringdans la liste des enfants du parent de ceChildNode, juste avant ceChildNode. Les objetsDOMStringsont ajoutés comme équivalent des noeudsText. -
ChildNode.after() -
ajoute un jeu d'objet
NodeouDOMStringdans la liste des enfants du parent de ceChildNode, juste après ceChildNode. Les objetsDOMStringsont ajoutés comme équivalent des noeudsText. -
ChildNode.replace() -
Remplace ce
ChildNodein the children list of its parent with a set ofNodeorDOMStringobjects.DOMStringobjects are inserted as equivalentTextnodes.
Specifications
| Specification | Status | Comment |
|---|---|---|
| DOM La définition de 'ChildNode' dans cette spécification. |
Living Standard | Splitted the ElementTraversal interface in ParentNode and ChildNode. The previousElementSibling and nextElementSibling are now defined on the latter.The CharacterData and DocumentType implemented the new interfaces.Added the remove(), before(), after() and replace() methods. |
| Element Traversal Specification La définition de 'ElementTraversal' dans cette spécification. |
Recommendation | Added the initial definition of its properties to the ElementTraversal pure interface and use it on Element. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
Basic support (on Element) |
1.0 | 23.0 (23.0) | 9.0 [1] | 10.0 | 4.0 |
Support on DocumentType and CharacterData |
23.0 | 23.0 (23.0) | Pas de support | 16.0 | Pas de support |
previousElementSibling and nextElementSibling |
1.0 | 3.5 (1.9.1) on Element25.0 (25.0) |
9.0 [1] | 10.0 | 4.0 |
remove() |
29.0 | 23.0 (23.0) | Pas de support | 16.0 | Pas de support |
before(), after(), and replace() |
Pas de support | Pas de support | Pas de support | Pas de support | Pas de support |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
Basic support (on Element) |
(Oui) | 23.0 (23.0) | (Oui) | 10.0 | (Oui) |
Support on DocumentType and CharacterData |
(Oui) | 23.0 (23.0) | Pas de support | 16.0 | Pas de support |
previousElementSibling and nextElementSibling |
(Oui) | 1.0 (1.9.1) on Element |
(Oui) | 10.0 | (Oui) |
remove() |
(Oui) | 23.0 (23.0) | Pas de support | 16.0 | Pas de support |
before(), after(), and replace() |
Pas de support | Pas de support | Pas de support | Pas de support | Pas de support |
See also
- The
ParentNodepure interface.