1.0.0 • Published 10 years ago
@f/contains-element v1.0.0
contains-element
Check if one element contains another element
Installation
$ npm install @f/contains-elementUsage
var contains = require('@f/contains-element')
function checkHoverOnMouseMove (e, regionElement) {
return contains(regionElement, e.target)
}API
containsElement(parent, child)
parent- The node to check ifchildis inside ofchild- The node you want to check to see if it's inside ofparent
Returns: A Boolean value indicating whether or not child is inside of parent in the DOM hierarachy. Note that this is not a strict containment relation, parent === child will result in true.
License
MIT
1.0.0
10 years ago