|
пре 1 година | |
---|---|---|
.. | ||
CHANGELOG.md | пре 1 година | |
LICENSE.md | пре 1 година | |
README.md | пре 1 година | |
index.js | пре 1 година | |
package.json | пре 1 година |
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