0.3.0 • Published 8 years ago

properjs-matchelement v0.3.0

Weekly downloads
9
License
-
Repository
github
Last release
8 years ago

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
}