Nominal Pizza Masticator
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

properjs-matchelement

0.3.0 • Public • Published

matchElement

Use native element selector matching. Matches element or can walk the DOM to check ancestor elements.

Installation

npm install properjs-matchelement --save-dev

Usage

var matchElement = require( "properjs-matchelement" );
 
// Test if element matches selector
if ( matchElement( element, selector ) ) {
    // It matches, do stuff with it
}
 
// Test if element or parent/ancestor matches selector
if ( matchElement( element, selector, true ) ) {
    // It matches, do stuff with it
}

install

npm i properjs-matchelement

Downloadsweekly downloads

24

version

0.3.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar