0.3.0 • Published 8 years ago
properjs-matchelement v0.3.0
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
}