component-matches-selector

Check if an element matches a given selector

Usage no npm install needed!

<script type="module">
  import componentMatchesSelector from 'https://cdn.skypack.dev/component-matches-selector';
</script>

README

matches-selector

Check if an element matches a given selector.

Installation

$ component install component/matches-selector

Example

var matches = require('matches-selector');
matches(el, 'ul li a');
// => true

License

MIT