sp

select-parent

querySelector but for parent nodes

Showing:

Popularity

Downloads/wk

572

GitHub Stars

1

Maintenance

Last Commit

7yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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'))

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100