Tag javascript html dom collections example

JavaScript HTML DOM Collections

The HTMLCollection Object The getElementsByTagName() method returns an HTMLCollection object. An HTMLCollection object is an array-like list (collection) of HTML elements. The following code selects all <p> elements in a document: Example const myCollection = document.getElementsByTagName(“p”); The elements in the…