seelct element by classname javascript code example
Example 1: how to get element by class name javascript
document.getElementsByClassName("legend").style.display="none";
Example 2: element.classname javascript
let el = document.getElementById('item');
if (el.className === 'active'){
el.className = 'inactive';
} else {
el.className = 'active';
}