js DOM classname code example
Example 1: html get class property
let element = document.querySelector('.preset');
let style = getComputedStyle(element);
let bg = style.backgroundColor;
Example 2: element.classname javascript
let el = document.getElementById('item');
if (el.className === 'active'){
el.className = 'inactive';
} else {
el.className = 'active';
}