Check if an element has given class

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

See also