https://github.com/stevenvachon/is-dom-void
Determine if an object is a void HTMLElement (from any Realm).
https://github.com/stevenvachon/is-dom-void
dom element void-elements
Last synced: 11 months ago
JSON representation
Determine if an object is a void HTMLElement (from any Realm).
- Host: GitHub
- URL: https://github.com/stevenvachon/is-dom-void
- Owner: stevenvachon
- License: mit
- Created: 2019-07-04T20:54:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T09:07:52.000Z (almost 6 years ago)
- Last Synced: 2025-05-17T00:37:29.074Z (about 1 year ago)
- Topics: dom, element, void-elements
- Language: JavaScript
- Size: 138 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-dom-void [![NPM Version][npm-image]][npm-url] ![File Size][filesize-image] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url]
> Determine if an object is a [void `HTMLElement`](https://www.w3.org/TR/html5/syntax.html#void-elements) (from any `Realm`).
## Installation
[Node.js](http://nodejs.org) `>= 10` is required. To install, type this at the command line:
```shell
npm install is-dom-void
```
## Importing
ES Module:
```js
import isDOMVoidElement from 'is-dom-void';
```
CommonJS Module:
```js
const isDOMVoidElement = require('is-dom-void');
```
## Usage
```js
isDOMVoidElement(document.createElement('div')); //-> false
isDOMVoidElement(document.createElement('input')); //-> true
````
[npm-image]: https://img.shields.io/npm/v/is-dom-void.svg
[npm-url]: https://npmjs.com/package/is-dom-void
[filesize-image]: https://img.shields.io/badge/size-530B%20gzipped-blue.svg
[travis-image]: https://img.shields.io/travis/stevenvachon/is-dom-void.svg
[travis-url]: https://travis-ci.org/stevenvachon/is-dom-void
[coveralls-image]: https://img.shields.io/coveralls/stevenvachon/is-dom-void.svg
[coveralls-url]: https://coveralls.io/github/stevenvachon/is-dom-void
[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/is-dom-void.svg
[greenkeeper-url]: https://greenkeeper.io/