Check if an element has given class

ele.classList.contains('class-name');

More

Previous
Check an element against a selector
Next
Check if an element is a descendant of another