html-void-elements

List of known void HTML elements

Usage no npm install needed!

<script type="module">
  import htmlVoidElements from 'https://cdn.skypack.dev/html-void-elements';
</script>

README

html-void-elements

Build Coverage Downloads Size

List of known void HTML elements. Includes ancient (such as nextid and basefont) and modern (such as img and meta) tag names from the HTML living standard.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install html-void-elements

Use

import {htmlVoidElements} from 'html-void-elements'

console.log(htmlVoidElements)

Yields:

[
  'area',
  'base',
  'basefont',
  'bgsound',
  'br',
  'col',
  'command',
  'embed',
  'frame',
  'hr',
  'image',
  'img',
  'input',
  'isindex',
  'keygen',
  'link',
  'menuitem',
  'meta',
  'nextid',
  'param',
  'source',
  'track',
  'wbr'
]

API

This package exports the following identifiers: htmlVoidElements. There is no default export.

htmlVoidElements

string[] — List of lowercase tag names.

License

MIT © Titus Wormer