0.1.4 • Published 3 years ago
@afoot/lineage v0.1.4
lineage
Traverse up the DOM tree to a specific parent or all the way up to body. Returns an array of DOM nodes. Especially useful for event handling and verifying currentTaraget elements are children of target parents.
usage
import (Lineage) from '@afoot/lineage';
const lineage = Lineage(document.querySelector('.foo'));
console.log(lineage); // Returns ['.foo','body']