JavaScript and DOM
R&D 03: DOM: HTMLCollection and NodeList




About HTMLCollection

Summary

According to MDN Web Docs, "The HTMLCollection interface represents a generic collection … of elements … and offers methods and properties for selecting from the list."


About NodeList

Summary

According to MDN Web Docs, "NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll()."


Differences Between HTMLCollection and NodeList

Summary

The NodeList interface is almost always dynamic; the only method that can return a static NodeList is document.querySelectorAll(). On the other hand, the HTMLCollection interface is always dynamic; there is no way to create a static HTMLCollection.


Grand Summary

This R&D page contains information about the following topics:

  • HTMLCollection
  • NodeList