Answers for "javascript Element.matches() function"

0

javascript Element.matches() function

var elem = document.querySelector('#sandwich');
if (elem.matches('.turkey')) {
	console.log('It matches!');
} else {
	console.log('Not a match... =(');
}
Posted by: Guest on July-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language