dom-contains

Determines whether or not one HTMLElement is or contains another HTMLElement.

Usage no npm install needed!

<script type="module">
  import domContains from 'https://cdn.skypack.dev/dom-contains';
</script>

README

dom-contains

Determines whether or not one HTMLElement is or contains another HTMLElement.

This is a commonjs clone for Y.DOM.contains.

var contains = require('dom-contains');

contains(element, needle)

Return a boolean.

Whether or not the element is or contains the needle.

element

Type: HTMLElement

The containing html element.

needle

Type: HTMLElement

The html element that may be contained.