Как использовать Matches () в JavaScript
let abc = document.getElementById("abc");
console.log(abc.matches('.myclass'));
/*yields true. Asks 'does this element have this selector' */
Javasper