How to check if an element contains a class using JavaScript?

Hi all! Another question in regards to my stat module from before. I am trying to use JavaScript to check if the container contains the class "dark-bg" and then do something else. I have tried .matches() and classList.has() it keeps giving me an error. Any help would be grealy appreciated!

https://codepen.io/rnkwill/pen/OJrzroj
CodePenWill
...
OJrzroj
Was this page helpful?