node-is-ancestor-of

1.0.0 • Public • Published

Node is ancestor of

Check if node is ancestor of descendant

Install

  • NPM
    npm install --save node-is-ancestor-of
  • Yarn
    yarn add node-is-ancestor-of

Usage

const isAncestorOf = require('node-is-ancestor-of')
 
const el1 = document.getElementById('el1')
const el2 = document.getElementById('el2')
console.log(isAncestorOf(el1, el2))
// return true if el1 is ancestor of el2
// return false if el1 is not ancestor of el2

License

MIT © Roman Masyhar

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    48
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    48

Package Sidebar

Install

npm i node-is-ancestor-of

Weekly Downloads

48

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rohmanhm