Closed jaandrle closed 3 years ago
Different kinds of DOM collections: – Static NodeList [1]: .querySelectorAll() – Live NodeList [1]: .childNodes – HTMLCollection—always live [2]: .getElementsByClassName(), .getElementsByTagName() [1] https://t.co/RVYdbwxU5i [2] https://t.co/TIo4Fsyb4c Viz Axel Rauschmayer on Twitter. Iterace document.forms //= HTMLCollection [] document.forms.forEach //= undefined document.body.childNodes //= NodeList(3) [text, div.content, text] document.body.childNodes.forEach //= ƒ forEach() { [native code] } document.querySelectorAll("form") //= NodeList [] document.querySelectorAll("form").forEach //= ƒ forEach() { [native code] }
Different kinds of DOM collections: – Static NodeList [1]: .querySelectorAll() – Live NodeList [1]: .childNodes – HTMLCollection—always live [2]: .getElementsByClassName(), .getElementsByTagName()
[1] https://t.co/RVYdbwxU5i [2] https://t.co/TIo4Fsyb4c
Viz Axel Rauschmayer on Twitter.
document.forms //= HTMLCollection [] document.forms.forEach //= undefined document.body.childNodes //= NodeList(3) [text, div.content, text] document.body.childNodes.forEach //= ƒ forEach() { [native code] } document.querySelectorAll("form") //= NodeList [] document.querySelectorAll("form").forEach //= ƒ forEach() { [native code] }
Rozcestník