Javascript Getelementsbyname Method
Javascript Getelementsbyname Method
The method requires you to pass the name attribute that you want to search
for on your current HTML page.
console.log(elements); // [p]
console.log(elements[0]); // <p name="opening">Opening paragraph</p>
This means you can get multiple elements that have the same name attribute in
your HTML page.
The elements will be ordered from the first element found at the top to the
last one at the bottom.
If you want to do something with all elements that match your selection, you
need to use the document.querySelectorAll() method.