ancestors
0.0.3 • Public • Published ancestors
return a list of a node's ancestors, optionally filtered with a provided function.
var parents = require('ancestors')
, el = document.getElementById('target')
var p = parents(el)
var p = parents(el, function(node) { return node.tagName == 'div' })
API
parents(element[, filterFunction]) -> [list of elements]
License
MIT
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads