A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/wooorm/html-element-attributes below:

wooorm/html-element-attributes: Map of HTML elements to allowed attributes

Map of HTML elements to allowed attributes.

This is a map of tag names to lists of allowed attributes. Global attributes are stored at the special tag name *. All attributes from HTML 4 and the current living HTML spec are included.

👉 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.

You can use this to figure out if certain attributes are allowed on certain HTML elements.

This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:

npm install html-element-attributes

In Deno with esm.sh:

import {htmlElementAttributes} from 'https://esm.sh/html-element-attributes@3'

In browsers with esm.sh:

<script type="module">
  import {htmlElementAttributes} from 'https://esm.sh/html-element-attributes@3?bundle'
</script>
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']

This package exports the identifier htmlElementAttributes. There is no default export.

Map of lowercase HTML elements to allowed attributes (Record<string, Array<string>>).

This package is fully typed with TypeScript. It exports no additional types.

This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.

This package is safe.

Yes please! See How to Contribute to Open Source.

MIT © Titus Wormer


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4