matches-selector

Check if a DOM element matches a given selector, with decent browser support and unit tests.

MIT 5 个版本
安装
npm install matches-selector
yarn add matches-selector
pnpm add matches-selector
bun add matches-selector
README

matches-selector

Check if an element matches a given selector. For use with browserify.

Dependency Status NPM version

browser support

Installation

$ npm install matches-selector

Example

var matches = require('matches-selector');
matches(el, 'ul li a');
// => true or false

Running Tests

Tests can be easilly run locally in the browser of your choice, and have passed if it ends with # ok. They are also run on testling-ci when pushed to the repository:

npm install
npm test

To re-run tests after making changes, just refresh your browser

License

MIT

版本列表
1.2.0 2017-06-23
1.1.0 2017-06-23
1.0.0 2013-12-31
0.0.2 2013-10-19
0.0.1 2013-03-13