Skip to content

niftinessafoot/lineage

Repository files navigation

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 currentTarget elements are children of target parents.

usage

import (Lineage) from '@afoot/lineage';
const lineage = Lineage(document.querySelector('.foo'));
console.log(lineage); // Returns ['.foo','body']

license

MIT © Matthew Smith

made with ❤️ and ☕️ by

Niftiness Afoot! Matthew Smith

About

Traverse up the DOM tree from a specified element.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •