getElementsByTagName() returns all elements of a given type. Like class selection, it returns a live collection.
const paragraphs = document.getElementsByTagName("p");
const divs = document.getElementsByTagName("div");
Use this when you need all elements of a specific type.