La méthode TreeWalker.nextNode()
déplace le Node
courant au noeud suivant visible dans l'ordre du document et renvoie le noeud trouvé. Elle déplace aussi le noeud courant vers celui-ci. Si aucun noeud n'existe, elle renvoie null
et le noeud courant est inchangé.
Syntaxe
node = treeWalker.nextNode();
Exemple
var treeWalker = document.createTreeWalker( document.body, NodeFilter.SHOW_ELEMENT, { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } }, false ); var node = treeWalker.nextNode(); // renvoie le premier enfant de la racine, car il s'agit du noeud suivant dans l'ordre du document
Spécifications
Spécification | Statut | Commentaire |
---|---|---|
DOM La définition de 'TreeWalker.nextNode' dans cette spécification. |
Standard évolutif | Pas de changement de Document Object Model (DOM) Level 2 Traversal and Range Specification |
Document Object Model (DOM) Level 2 Traversal and Range Specification La définition de 'TreeWalker.nextNode' dans cette spécification. |
Obsolete | Définition initiale. |
Compatibilité des navigateurs
Nous convertissons les données de compatibilité dans un format JSON.
Ce tableau de compatibilité utilise encore l'ancien format
car nous n'avons pas encore converti les données qu'il contient.
Vous pouvez nous aider en contribuant !
Fonctionnalité | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 1.0 | (Oui) | 2.0 (1.8.1) | 9.0 | 9.0 | 3.0 |
Fonctionnalité | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | (Oui) | (Oui) | 1.0 (1.8.1) | (Oui) | 9.0 | 3.0 |
Voir aussi
- L'interface
TreeWalker
à laquelle elle appartient.