Denis 346b78aee1 first commit vor 2 Jahren
..
index.json 346b78aee1 first commit vor 2 Jahren
license 346b78aee1 first commit vor 2 Jahren
package.json 346b78aee1 first commit vor 2 Jahren
readme.md 346b78aee1 first commit vor 2 Jahren

readme.md

html-element-attributes

Build Downloads Size

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

npm:

npm install html-element-attributes

Use

var htmlElementAttributes = require('html-element-attributes')

console.log(htmlElementAttributes['*'])
console.log(htmlElementAttributes.ol)

Yields:

[ 'accesskey',
  'autocapitalize',
  'autofocus',
  'class',
  // ...
  'style',
  'tabindex',
  'title',
  'translate' ]
[ '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.

Related

License

MIT © Titus Wormer