getElementById
returns a single DOM element whose ID matches your query. getElementsByClassName
returns an HtmlCollection
- an array-like structure containing the DOM elements that matched your query. You have to iterate through each element in the array to apply your style.