Narcissistic Passion Minified
    Wondering what’s next for npm?Check out our public roadmap! »

    select-parent

    1.0.1 • Public • Published

    select-parent

    querySelector but for parent nodes. Given a node, selects the parent/ancestor that matches the given selector.

    Install

    $ npm install --save select-parent

    Usage

    var selectParent = require('select-parent')
     
    var redDiv = selectParent('div.red', document.getElementById('inner-div'))
     

    Or you can use the curried form as well.

     
    var selectParent = require('select-parent')
     
    var selectRed = selectParent('div.red')
     
    var redDiv = selectRed(document.getElementById('nested-div'))

    Install

    npm i select-parent

    DownloadsWeekly Downloads

    1,164

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar