get class name from element javascript code example
Example 1: how get class name
String className = this.getClass().getSimpleName();
Example 2: get name of class javascript
myObj.constructor.name
Example 3: html get class property
let element = document.querySelector('.preset');
let style = getComputedStyle(element);
let bg = style.backgroundColor;