You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
3 weeks ago | |
---|---|---|
.. | ||
CHANGELOG.md | 3 weeks ago | |
LICENSE.md | 3 weeks ago | |
README.md | 3 weeks ago | |
index.js | 3 weeks ago | |
package.json | 3 weeks ago |
README.md
dom-matches
Check if a DOM element matches a given selector.
Installation
npm install dom-matches
API
matches(elem, selector)
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
Browser support
- Google Chrome
- Firefox ESR+
- Internet Explorer 10+
- Safari 6+
- Opera