contains

Check whether a DOM element is contained by another one

contains

[![dependency status][3]][4]

Check whether a DOM element is contained by another one

var contains = require("contains")
 
var container = document.getElementById("container")
var someElem = document.getElementById("someElem")
 
// does container contain someElem as a child? 
var contained = contains(container, someElem)

npm install contains

  • Raynos