Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zoubin/dom-contains

Determines whether or not one HTMLElement is or contains another HTMLElement.
https://github.com/zoubin/dom-contains

Last synced: 8 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# dom-contains
Determines whether or not one HTMLElement is or contains another HTMLElement.

This is a commonjs clone for [Y.DOM.contains](http://yuilibrary.com/yui/docs/api/classes/DOM.html#method_contains).

```javascript
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.