This tutorial shows you how to select elements by name using the JavaScript getElementsByName() method
Selecting
Selecting Elements By Tag Name
Select elements that match a tag name using the getElementsByTagName() method.
Selecting Elements By Class Name
Select elements that match a class name using the getElementsByClassName method.
Selecting an Element By Id
Select an element that matches the id using the getElementById() method.
Selecting Elements By CSS Selector
Select elements that match a CSS selector using the querySeelctor() and querySelectorAll() methods.