Dear,
What the method you are using is to obtain all the elements that have the value that you give as a parameter.
For example:
<div id="test" class="xclass">88</div>
var x = document.getElementsByClassName("xclass");
With that you would get the div that has the class that has the value you give it.
In the question you do not understand what you are looking for.
If what you need is to obtain the value of the class attribute of a certain element, you must first determine how to find the element in the DOM, for example if it has an id it can be done in the following way:
document.getElementById("test").getAttribute("class")
will give you similar values to the following:
xclass
If what you need is the value of a tag according to the name of the class for the same case it would be like this.
document.getElementsByClassName ("xclass"). innerHTML
This will give you: 88
Greetings!