NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/dom-matches/README.md

38 lines
599 B
Markdown
Raw Normal View History

2023-09-14 14:47:11 +08:00
# dom-matches
[![Build Status](https://secure.travis-ci.org/necolas/dom-matches.png?branch=master)](http://travis-ci.org/necolas/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.
```js
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