{"id":13721626,"url":"https://github.com/wooorm/html-element-attributes","last_synced_at":"2025-09-11T08:32:53.299Z","repository":{"id":57267351,"uuid":"54275927","full_name":"wooorm/html-element-attributes","owner":"wooorm","description":"Map of HTML elements to allowed attributes","archived":false,"fork":false,"pushed_at":"2024-04-03T12:50:15.000Z","size":117,"stargazers_count":60,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T05:05:06.967Z","etag":null,"topics":["attribute","html"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wooorm.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":"funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"wooorm"}},"created_at":"2016-03-19T16:36:58.000Z","updated_at":"2024-12-18T05:13:39.000Z","dependencies_parsed_at":"2024-04-03T13:50:35.219Z","dependency_job_id":"012a7015-078a-487f-97aa-e167df23f6ab","html_url":"https://github.com/wooorm/html-element-attributes","commit_stats":{"total_commits":89,"total_committers":3,"mean_commits":"29.666666666666668","dds":0.0337078651685393,"last_synced_commit":"c8295c511f9f7d6add7969febaed49eb2fd0b2a9"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fhtml-element-attributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fhtml-element-attributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fhtml-element-attributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fhtml-element-attributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wooorm","download_url":"https://codeload.github.com/wooorm/html-element-attributes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601449,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attribute","html"],"created_at":"2024-08-03T01:01:19.444Z","updated_at":"2025-09-11T08:32:53.283Z","avatar_url":"https://github.com/wooorm.png","language":"JavaScript","readme":"# html-element-attributes\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n\nMap of HTML elements to allowed attributes.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`htmlElementAttributes`](#htmlelementattributes)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis is a map of tag names to lists of allowed attributes.\nGlobal attributes are stored at the special tag name `*`.\nAll attributes from HTML 4 and the current living HTML spec are included.\n\n\u003e 👉 **Note**: Includes deprecated attributes.\n\n\u003e 👉 **Note**: Attributes which were not global in HTML 4 but are in HTML, are\n\u003e only included in the list of global attributes.\n\n## When should I use this?\n\nYou can use this to figure out if certain attributes are allowed on certain\nHTML elements.\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 14.14+, 16.0+), install with [npm][npmjs-install]:\n\n```sh\nnpm install html-element-attributes\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {htmlElementAttributes} from 'https://esm.sh/html-element-attributes@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {htmlElementAttributes} from 'https://esm.sh/html-element-attributes@3?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {htmlElementAttributes} from 'html-element-attributes'\n\nconsole.log(htmlElementAttributes['*'])\nconsole.log(htmlElementAttributes.ol)\n```\n\nYields:\n\n```js\n[\n  'accesskey',\n  'autocapitalize',\n  'autofocus',\n  'class',\n  // …\n  'style',\n  'tabindex',\n  'title',\n  'translate'\n]\n['compact', 'reversed', 'start', 'type']\n```\n\n## API\n\nThis package exports the identifier `htmlElementAttributes`.\nThere is no default export.\n\n### `htmlElementAttributes`\n\nMap of lowercase HTML elements to allowed attributes\n(`Record\u003cstring, Array\u003cstring\u003e\u003e`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 14.14+ and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Security\n\nThis package is safe.\n\n## Related\n\n* [`wooorm/web-namespaces`](https://github.com/wooorm/web-namespaces)\n  — list of web namespaces\n* [`wooorm/html-tag-names`](https://github.com/wooorm/html-tag-names)\n  — list of HTML tag names\n* [`wooorm/mathml-tag-names`](https://github.com/wooorm/mathml-tag-names)\n  — list of MathML tag names\n* [`wooorm/svg-tag-names`](https://github.com/wooorm/svg-tag-names)\n  — list of SVG tag names\n* [`wooorm/html-void-elements`](https://github.com/wooorm/html-void-elements)\n  — list of void HTML tag names\n* [`wooorm/svg-element-attributes`](https://github.com/wooorm/svg-element-attributes)\n  — map of SVG elements to attributes\n* [`wooorm/aria-attributes`](https://github.com/wooorm/aria-attributes)\n  — list of ARIA attributes\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][opensource-guide].\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n\u003c!-- Definition --\u003e\n\n[badge-build-image]: https://github.com/wooorm/html-element-attributes/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/wooorm/html-element-attributes/actions\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/wooorm/html-element-attributes.svg\n\n[badge-coverage-url]: https://codecov.io/github/wooorm/html-element-attributes\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/html-element-attributes.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/html-element-attributes\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/html-element-attributes\n\n[badge-size-url]: https://bundlejs.com/?q=html-element-attributes\n\n[esmsh]: https://esm.sh\n\n[file-license]: license\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[npmjs-install]: https://docs.npmjs.com/cli/install\n\n[opensource-guide]: https://opensource.guide/how-to-contribute/\n\n[typescript]: https://www.typescriptlang.org\n\n[wooorm]: https://wooorm.com\n","funding_links":["https://github.com/sponsors/wooorm"],"categories":["Github Repositories"],"sub_categories":["HTML stuff"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooorm%2Fhtml-element-attributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwooorm%2Fhtml-element-attributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooorm%2Fhtml-element-attributes/lists"}