Fun fact: getElementsByTagName returns an HTMLCollection, not a NodeList. It’s live, so when elements are removed or added, the collection updates automatically.
Other methods like getElementsByClassName, document.forms, and document.images also return live HTMLCollections.
December 6, 2024 at 2:15 PM
Fun fact: getElementsByTagName returns an HTMLCollection, not a NodeList. It’s live, so when elements are removed or added, the collection updates automatically.
Other methods like getElementsByClassName, document.forms, and document.images also return live HTMLCollections.