I want to check for the class name with JS. But as the element has several classes, the used command does not seem to work. How can I check for a single class?
HTML
<div class="first_class second_class third_class"> </div>
JS
var trg = e.target;
if ( trg.classList.contains('third_class') ) {
console.log(trg);
}