common-ancestor

Find the common ancestor of multiple DOM nodes

npm install common-ancestor
5 downloads in the last month

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

npm loves you