README
html-element-attributes
Map of HTML elements to allowed attributes.
Also contains global attributes under '*'
.
Includes attributes from HTML 4 and HTML (the WHATWG living standard).
Note: Includes deprecated attributes.
Note: Attributes which were not global in HTML 4 but are in HTML, are only included in the list of global attributes.
Install
This package is ESM only: Node 12+ is needed to use it and it must be import
ed
instead of require
d.
npm:
npm install html-element-attributes
Use
import {htmlElementAttributes} from 'html-element-attributes'
console.log(htmlElementAttributes['*'])
console.log(htmlElementAttributes.ol)
Yields:
[
'accesskey',
'autocapitalize',
'autofocus',
'class',
// …
'style',
'tabindex',
'title',
'translate'
]
['compact', 'reversed', 'start', 'type']
API
This package exports the following identifiers: htmlElementAttributes
.
There is no default export.
htmlElementAttributes
Object.<string, string[]>
— Map of lowercase tag names to an array of
lowercase attribute names.
The object contains one special key: '*'
, which contains global
attributes that apply to all HTML elements.
Related
web-namespaces
— List of web namespaceshtml-tag-names
— List of HTML tagsmathml-tag-names
— List of MathML tagssvg-tag-names
— List of SVG tagshtml-void-elements
— List of void HTML tag-namessvg-element-attributes
— Map of SVG elements to allowed attributesaria-attributes
— List of ARIA attributes