1.0.0 • Published 8 years ago

@f/contains-element v1.0.0

Weekly downloads
8
License
MIT
Repository
github
Last release
8 years ago

contains-element

Build status Git tag NPM version Code style

Check if one element contains another element

Installation

$ npm install @f/contains-element

Usage

var contains = require('@f/contains-element')

function checkHoverOnMouseMove (e, regionElement) {
  return contains(regionElement, e.target)
}

API

containsElement(parent, child)

  • parent - The node to check if child is inside of
  • child - The node you want to check to see if it's inside of parent

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