Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
html-element-attributes
Advanced tools
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.
htmlElementAttributes
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.
wooorm/web-namespaces
— list of web namespaceswooorm/html-tag-names
— list of HTML tag nameswooorm/mathml-tag-names
— list of MathML tag nameswooorm/svg-tag-names
— list of SVG tag nameswooorm/html-void-elements
— list of void HTML tag nameswooorm/svg-element-attributes
— map of SVG elements to attributeswooorm/aria-attributes
— list of ARIA attributesYes please! See How to Contribute to Open Source.
FAQs
Map of HTML elements to allowed attributes
The npm package html-element-attributes receives a total of 103,842 weekly downloads. As such, html-element-attributes popularity was classified as popular.
We found that html-element-attributes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.