List of HTML event handler attributes.
- What is this?
- When should I use this?
- Install
- Use
- API
- Types
- Compatibility
- Security
- Related
- Contribute
- License
This is a list of all HTML event handlers (onclick
, etc).
It includes events from HTML 4 and HTML (the living standard).
You can use this package if you want to figure out whether an HTML attribute is a known event handler.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install html-event-attributes
In Deno with esm.sh
:
import {htmlEventAttributes} from 'https://esm.sh/html-event-attributes@2'
In browsers with esm.sh
:
<script type="module">
import {htmlEventAttributes} from 'https://esm.sh/html-event-attributes@2?bundle'
</script>
import {htmlEventAttributes} from 'html-event-attributes'
console.log(htmlEventAttributes.slice(0, 10))
Yields:
[
'onabort',
'onafterprint',
'onauxclick',
'onbeforeprint',
'onbeforeunload',
'onblur',
'oncancel',
'oncanplay',
'oncanplaythrough',
'onchange'
]
This package exports the identifier htmlEventAttributes
.
There is no default export.
List of HTML event handler attributes (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/svg-event-attributes
— list of SVG event attributeswooorm/html-element-attributes
— map of HTML elements to attributeswooorm/svg-element-attributes
— map of SVG elements to attributeswooorm/aria-attributes
— list of ARIA attributes
Yes please! See How to Contribute to Open Source.