how to get class name of element in javascript code example
Example 1: how to get element by class name javascript
document.getElementsByClassName("legend").style.display="none";
Example 2: javascript get class name
document.getElementById("myDIV").className = "mystyle";
Example 3: get name of class javascript
myObj.constructor.name
Example 4: how get class name
String className = this.getClass().getSimpleName();