https://github.com/jlmakes/is-dom-node
ES module for type checking DOM Nodes.
https://github.com/jlmakes/is-dom-node
Last synced: 11 months ago
JSON representation
ES module for type checking DOM Nodes.
- Host: GitHub
- URL: https://github.com/jlmakes/is-dom-node
- Owner: jlmakes
- License: mit
- Created: 2018-01-06T15:09:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T19:51:16.000Z (over 8 years ago)
- Last Synced: 2025-02-13T16:48:47.998Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# is-dom-node
## Installation
### Browser
A simple and fast way to get started is to include this script on your page:
```html
```
This will create the global variable `isDomNode`.
### Module
```bash
npm install is-dom-node
```
#### CommonJS
```js
const isDomNode = require('is-dom-node')
```
#### ES2015
```js
import isDomNode from 'is-dom-node'
```
## Usage
```js
const node = document.querySelector('#cake')
isDomNode(node)
// => true
const html = '
'
isDomNode(html)
// => false
```