When changing from id to class, ensure you're correctly targeting the class name without the '.' prefix, as getElementsByClassName expects only the class name.
For multiple elements, getElementsByClassName or querySelectorAll will return a collection, so you need to handle each item within the collection appropriately.
Collection
[
|
...
]