|
il y a 1 an | |
---|---|---|
.. | ||
CHANGELOG.md | il y a 1 an | |
LICENSE.md | il y a 1 an | |
README.md | il y a 1 an | |
index.js | il y a 1 an | |
package.json | il y a 1 an |
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