Skip to content

micro-js/matches-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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