NodeList.values()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
La méthode NodeList.values()
renvoie un itérateur
permettant de parcourir toutes les valeurs contenues dans cet objet. Les valeurs sont des objets Node
(noeud).
Syntaxe
js
nodeList.values();
Valeur retournée
Renvoie un itérateur
.
Exemple
js
var node = document.createElement("div");
var kid1 = document.createElement("p");
var kid2 = document.createTextNode("hey");
var kid3 = document.createElement("span");
node.appendChild(kid1);
node.appendChild(kid2);
node.appendChild(kid3);
var list = node.childNodes;
// Utilisation de for..of
for (var value of list.values()) {
console.log(value);
}
Le résultat est :
<p> #text "hey" <span>
Spécifications
No specification found
No specification data found for api.NodeList.values
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Compatibilité des navigateurs
BCD tables only load in the browser