how to find class using javascript code example
Example 1: js check for class in classList
element.classList.contains(className);
Example 2: how to get element by class name javascript
document.getElementsByClassName("legend").style.display="none";