Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

desandro-matches-selector

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

desandro-matches-selector

matches/matchesSelector helper

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is desandro-matches-selector?

The desandro-matches-selector npm package is a utility for checking if a DOM element matches a given CSS selector. It provides a cross-browser solution for the Element.matches() method, ensuring compatibility with older browsers.

What are desandro-matches-selector's main functionalities?

Check if an element matches a selector

This feature allows you to check if a specific DOM element matches a given CSS selector. The code sample demonstrates how to use the package to verify if an element with the class 'my-element' matches the selector '.my-element'.

const matchesSelector = require('desandro-matches-selector');
const element = document.querySelector('.my-element');
const isMatch = matchesSelector(element, '.my-element');
console.log(isMatch); // true

Other packages similar to desandro-matches-selector

Keywords

FAQs

Package last updated on 10 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc