Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.17 KB

Readme.md

File metadata and controls

45 lines (28 loc) · 1.17 KB

matches-selector

Build status Git tag NPM version Code style

Polyfill for Element.prototype.matches

Installation

$ npm install @f/matches-selector

Usage

var matchesSelector = require('@f/matches-selector')


if (matchesSelector(':hover"'))

API

matchesSelector(node, selector)

  • node - DOM Element
  • selector - Selector. E.g. :hover, .modal.

Returns: Boolean indicating whether or not node matched selector.

License

MIT