1 | # matches-selector
|
2 |
|
3 | Check if an element matches a given selector. For use with browserify.
|
4 |
|
5 | [![Dependency Status](https://gemnasium.com/ForbesLindesay/matches-selector.png)](https://gemnasium.com/ForbesLindesay/matches-selector)
|
6 | [![NPM version](https://badge.fury.io/js/matches-selector.png)](http://badge.fury.io/js/matches-selector)
|
7 |
|
8 | [![browser support](https://ci.testling.com/ForbesLindesay/matches-selector.png)](https://ci.testling.com/ForbesLindesay/matches-selector)
|
9 |
|
10 | ## Installation
|
11 |
|
12 | $ npm install matches-selector
|
13 |
|
14 | ## Example
|
15 |
|
16 | ```js
|
17 | var matches = require('matches-selector');
|
18 | matches(el, 'ul li a');
|
19 | // => true or false
|
20 | ```
|
21 |
|
22 | ## Running Tests
|
23 |
|
24 | 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:
|
25 |
|
26 | ```
|
27 | npm install
|
28 | npm test
|
29 | ```
|
30 |
|
31 | To re-run tests after making changes, just refresh your browser
|
32 |
|
33 | ## License
|
34 |
|
35 | MIT
|