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

    properjs-matchelementpublic

    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

    21

    version

    0.3.0

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar