how to get a classname in javascript code example
Example 1: get name of class javascript
myObj.constructor.name
Example 2: element.classname javascript
let el = document.getElementById('item');
if (el.className === 'active'){
el.className = 'inactive';
} else {
el.className = 'active';
}