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.
- 6. Interacting with Your Web Page: Getting to know the DOM
- Publisher: O'Reilly Media, Inc.
- Released: March 2014
what are the other methods that are used to return elements whether by class or tag?