node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

common-ancestor

common-ancestor

dependency status

browser support

Find the common ancestor of multiple DOM nodes

Example

var commonAncestors = require("common-ancestor")
var document = require("global/document")
 
var head = document.head
var body = document.body
 
var ancestor = commonAncestors(head, body)
 
console.log("ancestor?", ancestor)

Installation

npm install common-ancestor

Contributors

  • Raynos

MIT Licenced