Package Exports
- html-element-attributes
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (html-element-attributes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
html-element-attributes

Map of HTML elements to allowed attributes. Also contains global
attributes under '*'
. Includes attributes from HTML 4, W3C HTML 5,
and WHATWG HTML 5.
Note: Includes deprecated attributes.
Note: Attributes which were not global in HTML 4 but are in HTML 5, are only included in the list of global attributes.
Installation
npm:
npm install html-element-attributes
html-element-attributes is also available as an AMD, CommonJS, and globals module, uncompressed and compressed.
Usage
Dependencies:
var htmlElementAttributes = require('html-element-attributes');
Global attributes:
var globals = htmlElementAttributes['*'];
Yields:
[ 'accesskey',
'class',
'contenteditable',
'contextmenu',
'dir',
'draggable',
'dropzone',
'hidden',
'id',
'itemid',
'itemprop',
'itemref',
'itemscope',
'itemtype',
'lang',
'spellcheck',
'style',
'tabindex',
'title',
'translate' ]
Attributes on the ol
element:
var ol = htmlElementAttributes.ol;
Yields:
[ 'compact', 'reversed', 'start', 'type' ]
API
htmlElementAttributes
Object.<Array.<string>>
— Map of lower-case tag-names to an array of
lower-case attribute names.
The object contains one special key: '*'
, which contains global
attributes which apply to all HTML elements.