As the title quotes, how do I get the class of a HTML element in Javascript when you know its innerHTML. For instance, if you have a button element, and its class is "classTest" and its innerHTML is "Click me" tag:
I got the innerHTML "Click me" and stored it in a var in my Javascript. But i want to know if it has the CSS class "classTest" or not.. Is there any way of doing it in Javascript? I have not found something that answers this question, if you know then please provide me with it. Thanks!