common-ancestor

Find the common ancestor of multiple DOM nodes

common-ancestor

Find the common ancestor of multiple DOM nodes

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)

npm install common-ancestor

  • Raynos