$ gnpm install dom-matches
Check if a DOM element matches a given selector.
npm install dom-matches
elem
: a DOM node.selector
: a CSS selector string.var matches = require('dom-matches');
var elem = document.querySelector('.foo');
matches(elem, '.foo');
// => true
matches(elem, '.bar');
// => false
Copyright 2013 - present © cnpmjs.org | Home |