Determine if an object is a void
HTMLElement
(from anyRealm
).
Node.js >= 10
is required. To install, type this at the command line:
npm install is-dom-void
ES Module:
import isDOMVoidElement from 'is-dom-void';
CommonJS Module:
const isDOMVoidElement = require('is-dom-void');
isDOMVoidElement(document.createElement('div')); //-> false
isDOMVoidElement(document.createElement('input')); //-> true