O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

there is another DOM method named getElementsByClassName that you can use to get elements by class name. With this method, what you get back is a collection of elements that belong to the class (because multiple elements can be in the same class). Another method that returns a collection of elements is getElementsByTagName, which returns all elements that match the tag name you specify. We’ll see getElementsByTagName a little later in the book and see how to handle the collection of elements it returns.


Cover of Head First JavaScript Programming


what are the other methods that are used to return elements whether by class or tag?