|
hai 1 ano | |
---|---|---|
.. | ||
CHANGELOG.md | hai 1 ano | |
LICENSE.md | hai 1 ano | |
README.md | hai 1 ano | |
index.js | hai 1 ano | |
package.json | hai 1 ano |
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