Currently, I am trying to determine whether a specific CSS class is being used within the DOM. To do this, I've utilized the following code snippet:
var x = document.getElementsByClassName('classname');
Upon inspecting the output of variable x, I noticed that it returns an [object NodeList] regardless of whether the class exists in the page's elements or not. Is there a method for accessing properties of x, such as tag name or other attributes? It would be greatly appreciated if anyone could provide insight on the different properties of x and how they can be accessed.
Thank you :)