Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jelmerdemaat/element-matches
Small `Element.matches` fix (IE 9+, Edge 12+, Android browsers)
https://github.com/jelmerdemaat/element-matches
Last synced: 4 days ago
JSON representation
Small `Element.matches` fix (IE 9+, Edge 12+, Android browsers)
- Host: GitHub
- URL: https://github.com/jelmerdemaat/element-matches
- Owner: jelmerdemaat
- License: other
- Created: 2018-01-15T15:24:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-15T16:38:30.000Z (almost 7 years ago)
- Last Synced: 2024-10-13T14:29:32.863Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `Element.matches`
[GitHub](https://github.com/jelmerdemaat/element-matches) | [NPM](https://www.npmjs.com/package/element-matches) | [@jelmerdemaat](https://twitter.com/jelmerdemaat)
Super small `Element.matches` fix for older browsers. The only thing this package does is add prefixes for:
* old IE versions (9+)
* IE mobile(10+)
* old Edge versions (12+)
* Safari (desktop) versions 5 - 7
* Safari & Chrome for iOS 4.1 - 7.1
* a number of Android browsers
* Android 2.2 - 4.4.4
* UC Browser 11.4
* Blackberry Browser 7+
* Samsung Internet 4See Can I Use data: [https://www.caniuse.com/#feat=matchesselector](https://www.caniuse.com/#feat=matchesselector)
## Usage
Install it and import it in your code:```sh
npm install --save element-matches
``````js
import 'element-matches';// Do some matching!
if (document.body.matches('.cool-body')) {
console.info('Yeay, I am cool!');
}
```