以下章节只涵盖合规的元素和特性。
This section is non-normative.
An asterisk (*) in a cell indicates that the actual rules are more complicated than indicated in the table above.
† Categories in the "Parents" column refer to parents that list
the given categories in their content model, not to elements that themselves are in those
categories. For example, the a
element's "Parents" column says "phrasing", so any
element whose content model contains the "phrasing" category could be a parent of an
a
element. Since the "flow" category includes all the "phrasing" elements, that means
the th
element could be a parent to an a
element.
This section is non-normative.
This section is non-normative.
Attribute | Element(s) | Description | Value |
---|---|---|---|
abbr
| th
| Alternative label to use for the header cell when referencing the cell in other contexts | Text* |
accept
| input
| Hint for expected file type in file upload controls | Set of comma-separated tokens* consisting of valid MIME type strings with no parameters or audio/* , video/* , or image/*
|
accept-charset
| form
| Character encodings to use for form submission | ASCII case-insensitive match for "UTF-8 "
|
accesskey
| HTML elements | Keyboard shortcut to activate or focus element | Ordered set of unique space-separated tokens, none of which are identical to another, each consisting of one code point in length |
action
| form
| URL to use for form submission | Valid non-empty URL potentially surrounded by spaces |
allow
| iframe
| Permissions policy to be applied to the iframe 's contents
| Serialized permissions policy |
allowfullscreen
| iframe
| Whether to allow the iframe 's contents to use requestFullscreen()
| Boolean attribute |
alt
| area ;
img ;
input
| Replacement text for use when images are not available | Text* |
as
| link
| Potential destination for a preload request (for rel ="preload " and rel ="modulepreload ")
| Potential destination, for rel ="preload "; script-like destination, for rel ="modulepreload "
|
async
| script
| Execute script when available, without blocking while fetching | Boolean attribute |
autocapitalize
| HTML elements | Recommended autocapitalization behavior (for supported input methods) | "on ";
"off ";
"none ";
"sentences ";
"words ";
"characters "
|
autocomplete
| form
| Default setting for autofill feature for controls in the form | "on "; "off "
|
autocomplete
| input ;
select ;
textarea
| Hint for form autofill feature | Autofill field name and related tokens* |
autofocus
| HTML elements | Automatically focus the element when the page is loaded | Boolean attribute |
autoplay
| audio ;
video
| Hint that the media resource can be started automatically when the page is loaded | Boolean attribute |
charset
| meta
| Character encoding declaration | "utf-8 "
|
checked
| input
| Whether the control is checked | Boolean attribute |
cite
| blockquote ;
del ;
ins ;
q
| Link to the source of the quotation or more information about the edit | Valid URL potentially surrounded by spaces |
class
| HTML elements | Classes to which the element belongs | Set of space-separated tokens |
color
| link
| Color to use when customizing a site's icon (for rel ="mask-icon ")
| CSS <color> |
cols
| textarea
| Maximum number of characters per line | Valid non-negative integer greater than zero |
colspan
| td ;
th
| Number of columns that the cell is to span | Valid non-negative integer greater than zero |
content
| meta
| Value of the element | Text* |
contenteditable
| HTML elements | Whether the element is editable | "true "; "false "
|
controls
| audio ;
video
| Show user agent controls | Boolean attribute |
coords
| area
| Coordinates for the shape to be created in an image map | Valid list of floating-point numbers* |
crossorigin
| audio ;
img ;
link ;
script ;
video
| How the element handles crossorigin requests | "anonymous "; "use-credentials "
|
data
| object
| Address of the resource | Valid non-empty URL potentially surrounded by spaces |
datetime
| del ;
ins
| Date and (optionally) time of the change | Valid date string with optional time |
datetime
| time
| Machine-readable value | Valid month string, valid date string, valid yearless date string, valid time string, valid local date and time string, valid time-zone offset string, valid global date and time string, valid week string, valid non-negative integer, or valid duration string |
decoding
| img
| Decoding hint to use when processing this image for presentation | "sync ";
"async ";
"auto "
|
default
| track
| Enable the track if no other text track is more suitable | Boolean attribute |
defer
| script
| Defer script execution | Boolean attribute |
dir
| HTML elements | The text directionality of the element | "ltr "; "rtl "; "auto "
|
dir
| bdo
| The text directionality of the element | "ltr "; "rtl "
|
dirname
| input ;
textarea
| Name of form control to use for sending the element's directionality in form submission | Text* |
disabled
| button ;
input ;
optgroup ;
option ;
select ;
textarea ;
form-associated custom elements
| Whether the form control is disabled | Boolean attribute |
disabled
| fieldset
| Whether the descendant form controls, except any inside legend , are disabled
| Boolean attribute |
disabled
| link
| Whether the link is disabled | Boolean attribute |
download
| a ;
area
| Whether to download the resource instead of navigating to it, and its file name if so | Text |
draggable
| HTML elements | Whether the element is draggable | "true "; "false "
|
enctype
| form
| Entry list encoding type to use for form submission | "application/x-www-form-urlencoded "; "multipart/form-data "; "text/plain "
|
enterkeyhint
| HTML elements | Hint for selecting an enter key action | "enter ";
"done ";
"go ";
"next ";
"previous ";
"search ";
"send "
|
for
| label
| Associate the label with form control | ID* |
for
| output
| Specifies controls from which the output was calculated | Unordered set of unique space-separated tokens consisting of IDs* |
form
| button ;
fieldset ;
input ;
object ;
output ;
select ;
textarea ;
form-associated custom elements
| Associates the element with a form element
| ID* |
formaction
| button ;
input
| URL to use for form submission | Valid non-empty URL potentially surrounded by spaces |
formenctype
| button ;
input
| Entry list encoding type to use for form submission | "application/x-www-form-urlencoded "; "multipart/form-data "; "text/plain "
|
formmethod
| button ;
input
| Variant to use for form submission | "GET ";
"POST ";
"dialog "
|
formnovalidate
| button ;
input
| Bypass form control validation for form submission | Boolean attribute |
formtarget
| button ;
input
| Browsing context for form submission | Valid browsing context name or keyword |
headers
| td ;
th
| The header cells for this cell | Unordered set of unique space-separated tokens consisting of IDs* |
height
| canvas ;
embed ;
iframe ;
img ;
input ;
object ;
video
| Vertical dimension | Valid non-negative integer |
hidden
| Whether the element is relevant | Boolean attribute | |
high
| meter
| Low limit of high range | Valid floating-point number* |
href
| a ;
area
| Address of the hyperlink | Valid URL potentially surrounded by spaces |
href
| link
| Address of the hyperlink | Valid non-empty URL potentially surrounded by spaces |
href
| base
| Document base URL | Valid URL potentially surrounded by spaces |
hreflang
| a ;
link
| Language of the linked resource | Valid BCP 47 language tag |
http-equiv
| meta
| Pragma directive | "content-type ";
"default-style ";
"refresh ";
"x-ua-compatible ";
"content-security-policy "
|
id
| HTML elements | The element's ID | Text* |
imagesizes
| link
| Image sizes for different page layouts (for rel ="preload ")
| Valid source size list |
imagesrcset
| link
| Images to use in different situations, e.g., high-resolution displays, small monitors, etc. (for rel ="preload ")
| Comma-separated list of image candidate strings |
inputmode
| HTML elements | Hint for selecting an input modality | "none ";
"text ";
"tel ";
"email ";
"url ";
"numeric ";
"decimal ";
"search "
|
integrity
| link ;
script
| Integrity metadata used in Subresource Integrity checks [SRI] | Text |
is
| HTML elements | Creates a customized built-in element | Valid custom element name of a defined customized built-in element |
ismap
| img
| Whether the image is a server-side image map | Boolean attribute |
itemid
| HTML elements | Global identifier for a microdata item | Valid URL potentially surrounded by spaces |
itemprop
| HTML elements | Property names of a microdata item | Unordered set of unique space-separated tokens consisting of valid absolute URLs, defined property names, or text* |
itemref
| HTML elements | Referenced elements | Unordered set of unique space-separated tokens consisting of IDs* |
itemscope
| HTML elements | Introduces a microdata item | Boolean attribute |
itemtype
| HTML elements | Item types of a microdata item | Unordered set of unique space-separated tokens consisting of valid absolute URLs* |
kind
| track
| The type of text track | "subtitles ";
"captions ";
"descriptions ";
"chapters ";
"metadata "
|
label
| optgroup ;
option ;
track
| User-visible label | Text |
lang
| HTML elements | Language of the element | Valid BCP 47 language tag or the empty string |
list
| input
| List of autocomplete options | ID* |
loading
| img ;
iframe
| Used when determining loading deferral | "lazy ";
"eager "
|
loop
| audio ;
video
| Whether to loop the media resource | Boolean attribute |
low
| meter
| High limit of low range | Valid floating-point number* |
manifest
| html
| Application cache manifest | Valid non-empty URL potentially surrounded by spaces |
max
| input
| Maximum value | Varies* |
max
| meter ;
progress
| Upper bound of range | Valid floating-point number* |
maxlength
| input ;
textarea
| Maximum length of value | Valid non-negative integer |
media
| link ;
source ;
style
| Applicable media | Valid media query list |
method
| form
| Variant to use for form submission | "GET ";
"POST ";
"dialog "
|
min
| input
| Minimum value | Varies* |
min
| meter
| Lower bound of range | Valid floating-point number* |
minlength
| input ;
textarea
| Minimum length of value | Valid non-negative integer |
multiple
| input ;
select
| Whether to allow multiple values | Boolean attribute |
muted
| audio ;
video
| Whether to mute the media resource by default | Boolean attribute |
name
| button ;
fieldset ;
input ;
output ;
select ;
textarea ;
form-associated custom elements
| Name of the element to use for form submission and in the form.elements API
| Text* |
name
| form
| Name of form to use in the document.forms API
| Text* |
name
| iframe ;
object
| Name of nested browsing context | Valid browsing context name or keyword |
name
| map
| Name of image map to reference from the usemap attribute
| Text* |
name
| meta
| Metadata name | Text* |
name
| param
| Name of parameter | Text |
name
| slot
| Name of shadow tree slot | Text |
nomodule
| script
| Prevents execution in user agents that support module scripts | Boolean attribute |
nonce
| HTML elements | Cryptographic nonce used in Content Security Policy checks [CSP] | Text |
novalidate
| form
| Bypass form control validation for form submission | Boolean attribute |
open
| details
| Whether the details are visible | Boolean attribute |
open
| dialog
| Whether the dialog box is showing | Boolean attribute |
optimum
| meter
| Optimum value in gauge | Valid floating-point number* |
pattern
| input
| Pattern to be matched by the form control's value | Regular expression matching the JavaScript Pattern production |
ping
| a ;
area
| URLs to ping | Set of space-separated tokens consisting of valid non-empty URLs |
placeholder
| input ;
textarea
| User-visible label to be placed within the form control | Text* |
playsinline
| video
| Encourage the user agent to display video content within the element's playback area | Boolean attribute |
poster
| video
| Poster frame to show prior to video playback | Valid non-empty URL potentially surrounded by spaces |
preload
| audio ;
video
| Hints how much buffering the media resource will likely need | "none ";
"metadata ";
"auto "
|
readonly
| input ;
textarea
| Whether to allow the value to be edited by the user | Boolean attribute |
readonly
| form-associated custom elements | Affects willValidate , plus any behavior added by the custom element author
| Boolean attribute |
referrerpolicy
| a ;
area ;
iframe ;
img ;
link ;
script
| Referrer policy for fetches initiated by the element | Referrer policy |
rel
| a ;
area
| Relationship between the location in the document containing the hyperlink and the destination resource | Unordered set of unique space-separated tokens* |
rel
| link
| Relationship between the document containing the hyperlink and the destination resource | Unordered set of unique space-separated tokens* |
required
| input ;
select ;
textarea
| Whether the control is required for form submission | Boolean attribute |
reversed
| ol
| Number the list backwards | Boolean attribute |
rows
| textarea
| Number of lines to show | Valid non-negative integer greater than zero |
rowspan
| td ;
th
| Number of rows that the cell is to span | Valid non-negative integer |
sandbox
| iframe
| Security rules for nested content | Unordered set of unique space-separated tokens, ASCII case-insensitive, consisting of
"allow-forms ",
"allow-modals ",
"allow-orientation-lock ",
"allow-pointer-lock ",
"allow-popups ",
"allow-popups-to-escape-sandbox ",
"allow-presentation ",
"allow-same-origin ",
"allow-scripts " and
"allow-top-navigation "
|
scope
| th
| Specifies which cells the header cell applies to | "row ";
"col ";
"rowgroup ";
"colgroup "
|
selected
| option
| Whether the option is selected by default | Boolean attribute |
shape
| area
| The kind of shape to be created in an image map | "circle ";
"default ";
"poly ";
"rect "
|
size
| input ;
select
| Size of the control | Valid non-negative integer greater than zero |
sizes
| link
| Sizes of the icons (for rel ="icon ")
| Unordered set of unique space-separated tokens, ASCII case-insensitive, consisting of sizes* |
sizes
| img ;
source
| Image sizes for different page layouts | Valid source size list |
slot
| HTML elements | The element's desired slot | Text |
span
| col ;
colgroup
| Number of columns spanned by the element | Valid non-negative integer greater than zero |
spellcheck
| HTML elements | Whether the element is to have its spelling and grammar checked | "true "; "false "
|
src
| audio ;
embed ;
iframe ;
img ;
input ;
script ;
source ;
track ;
video
| Address of the resource | Valid non-empty URL potentially surrounded by spaces |
srcdoc
| iframe
| A document to render in the iframe
| The source of an iframe srcdoc document*
|
srclang
| track
| Language of the text track | Valid BCP 47 language tag |
srcset
| img ;
source
| Images to use in different situations, e.g., high-resolution displays, small monitors, etc. | Comma-separated list of image candidate strings |
start
| ol
| Starting value of the list | Valid integer |
step
| input
| Granularity to be matched by the form control's value | Valid floating-point number greater than zero, or "any "
|
style
| HTML elements | Presentational and formatting instructions | CSS declarations* |
tabindex
| HTML elements | Whether the element is focusable and sequentially focusable, and the relative order of the element for the purposes of sequential focus navigation | Valid integer |
target
| a ;
area
| Browsing context for hyperlink navigation | Valid browsing context name or keyword |
target
| base
| Default browsing context for hyperlink navigation and form submission | Valid browsing context name or keyword |
target
| form
| Browsing context for form submission | Valid browsing context name or keyword |
title
| HTML elements | Advisory information for the element | Text |
title
| abbr ;
dfn
| Full term or expansion of abbreviation | Text |
title
| input
| Description of pattern (when used with pattern attribute)
| Text |
title
| link
| Title of the link | Text |
title
| link ;
style
| CSS style sheet set name | Text |
translate
| HTML elements | Whether the element is to be translated when the page is localized | "yes "; "no "
|
type
| a ;
link
| Hint for the type of the referenced resource | Valid MIME type string |
type
| button
| Type of button | "submit ";
"reset ";
"button "
|
type
| embed ;
object ;
source
| Type of embedded resource | Valid MIME type string |
type
| input
| Type of form control | input type keyword
|
type
| ol
| Kind of list marker | "1 ";
"a ";
"A ";
"i ";
"I "
|
type
| script
| Type of script | "module "; a valid MIME type string that is not a JavaScript MIME type essence match
|
usemap
| img ;
object
| Name of image map to use | Valid hash-name reference* |
value
| button ;
option
| Value to be used for form submission | Text |
value
| data
| Machine-readable value | Text* |
value
| input
| Value of the form control | Varies* |
value
| li
| Ordinal value of the list item | Valid integer |
value
| meter ;
progress
| Current value of the element | Valid floating-point number |
value
| param
| Value of parameter | Text |
width
| canvas ;
embed ;
iframe ;
img ;
input ;
object ;
video
| Horizontal dimension | Valid non-negative integer |
wrap
| textarea
| How the value of the form control is to be wrapped for form submission | "soft ";
"hard "
|
An asterisk (*) in a cell indicates that the actual rules are more complicated than indicated in the table above.
Support in all current engines.
Support in all current engines.
GlobalEventHandlers/ondragenter
Support in all current engines.
GlobalEventHandlers/ondragleave
Support in all current engines.
GlobalEventHandlers/ondragover
Support in all current engines.
GlobalEventHandlers/ondragstart
Support in all current engines.
Support in all current engines.
This section is non-normative.
This section is non-normative.
ApplicationCache
AudioTrack
AudioTrackList
BarProp
BeforeUnloadEvent
CanvasGradient
CanvasPattern
CanvasRenderingContext2D
CloseEvent
DOMParser
DataTransfer
DataTransferItem
DataTransferItemList
Document
, partial
DragEvent
ElementInternals
ErrorEvent
EventSource
External
FormDataEvent
HTMLAllCollection
HTMLAnchorElement
, partial
HTMLAreaElement
, partial
HTMLAudioElement
HTMLBRElement
, partial
HTMLBodyElement
, partial
HTMLButtonElement
HTMLCanvasElement
HTMLDListElement
, partial
HTMLDataElement
HTMLDataListElement
HTMLDetailsElement
HTMLDialogElement
HTMLDirectoryElement
HTMLDivElement
, partial
HTMLEmbedElement
, partial
HTMLFieldSetElement
HTMLFontElement
HTMLFormElement
HTMLFrameElement
HTMLFrameSetElement
HTMLHRElement
, partial
HTMLHeadingElement
, partial
HTMLHtmlElement
, partial
HTMLIFrameElement
, partial
HTMLImageElement
, partial
HTMLInputElement
, partial
HTMLLIElement
, partial
HTMLLabelElement
HTMLLegendElement
, partial
HTMLLinkElement
, partial
HTMLMapElement
HTMLMarqueeElement
HTMLMediaElement
HTMLMenuElement
, partial
HTMLMetaElement
, partial
HTMLMeterElement
HTMLModElement
HTMLOListElement
, partial
HTMLObjectElement
, partial
HTMLOptGroupElement
HTMLOptionElement
HTMLOutputElement
HTMLParagraphElement
, partial
HTMLParamElement
, partial
HTMLPictureElement
HTMLPreElement
, partial
HTMLProgressElement
HTMLQuoteElement
HTMLScriptElement
, partial
HTMLSelectElement
HTMLSlotElement
HTMLSourceElement
HTMLSpanElement
HTMLStyleElement
, partial
HTMLTableCaptionElement
, partial
HTMLTableCellElement
, partial
HTMLTableColElement
, partial
HTMLTableElement
, partial
HTMLTableRowElement
, partial
HTMLTableSectionElement
, partial
HTMLTemplateElement
HTMLTextAreaElement
HTMLTimeElement
HTMLTrackElement
HTMLUListElement
, partial
HTMLVideoElement
HashChangeEvent
History
ImageBitmap
ImageBitmapRenderingContext
ImageData
Location
MediaError
MessageChannel
MimeType
MimeTypeArray
Navigator
OffscreenCanvas
OffscreenCanvasRenderingContext2D
PageTransitionEvent
Path2D
Plugin
PluginArray
PopStateEvent
PromiseRejectionEvent
SharedWorker
Storage
StorageEvent
SubmitEvent
TextMetrics
TextTrack
TextTrackCue
TextTrackCueList
TextTrackList
TimeRanges
TrackEvent
ValidityState
VideoTrack
VideoTrackList
WebSocket
Window
, partial
Worker
WorkerLocation
WorkerNavigator
Worklet
WorkletGlobalScope
This section is non-normative.
Event | Interface | Interesting targets | Description |
---|---|---|---|
abort
| Event
| Window
| Fired at the Window when the download was aborted by the user
|
DOMContentLoaded
Support in all current engines. Firefox1+Safari3.1+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+Internet Explorer9+ Firefox Android4+Safari iOS2+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android10.1+ | Event
| Document
| Fired at the Document once the parser has finished
|
afterprint
Support in all current engines. Firefox6+Safari13+Chrome63+ Opera50+Edge79+ Edge (Legacy)12+Internet Explorer9+ Firefox Android6+Safari iOS13+Chrome Android63+WebView Android63+Samsung Internet8.0+Opera Android46+ | Event
| Window
| Fired at the Window after printing
|
beforeprint
Support in all current engines. Firefox6+Safari13+Chrome63+ Opera50+Edge79+ Edge (Legacy)12+Internet Explorer9+ Firefox Android6+Safari iOS13+Chrome Android63+WebView Android63+Samsung Internet8.0+Opera Android46+ | Event
| Window
| Fired at the Window before printing
|
beforeunload
Support in all current engines. Firefox1+Safari3+Chrome1+ Opera12+Edge79+ Edge (Legacy)12+Internet Explorer4+ Firefox Android4+Safari iOS1+Chrome Android18+WebView Android1+Samsung Internet1.0+Opera Android12+ | BeforeUnloadEvent
| Window
| Fired at the Window when the page is about to be unloaded, in case the page would like to show a warning prompt
|
blur
| Event
| Window , elements
| Fired at nodes when they stop being focused |
cancel
HTMLDialogElement/cancel_event Support in all current engines. Firefox98+Safari15.4+Chrome37+ Opera24+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android98+Safari iOS15.4+Chrome AndroidNoWebView AndroidNoSamsung InternetNoOpera AndroidNo | Event
| dialog elements
| Fired at dialog elements when they are canceled by the user (e.g. by pressing the Escape key)
|
change
| Event
| Form controls | Fired at controls when the user commits a value change (see also the input event)
|
click
| MouseEvent
| Elements | Normally a mouse event; also synthetically fired at an element before its activation behavior is run, when an element is activated from a non-pointer input device (e.g. a keyboard) |
close
Support in all current engines. Firefox98+Safari15.4+Chrome37+ Opera24+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android98+Safari iOS15.4+Chrome AndroidNoWebView AndroidNoSamsung InternetNoOpera AndroidNo | Event or CloseEvent
| dialog elements, WebSocket
| Fired at dialog elements when they are closed, and at WebSocket objects when the connection is terminated
|
connect
SharedWorkerGlobalScope/connect_event Firefox29+SafariNoChrome4+ Opera10.6+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android29+Safari iOSNoChrome Android18+WebView Android37+Samsung Internet1.0+Opera Android11+ | MessageEvent
| SharedWorkerGlobalScope
| Fired at a shared worker's global scope when a new client connects |
contextmenu
| MouseEvent
| Elements | Fired at elements when the user requests their context menu |
copy
| Event
| Elements | Fired at elements when the user copies data to the clipboard |
cut
| Event
| Elements | Fired at elements when the user copies the selected data on the clipboard and removes the selection from the document |
error
Support in all current engines. Firefox6+Safari5+Chrome6+ Opera12+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android45+Safari iOS5+Chrome Android18+WebView Android4.4+Samsung Internet1.0+Opera Android12+ | Event or ErrorEvent
| Global scope objects, Worker objects, elements, networking-related objects
| Fired when unexpected errors occur (e.g. networking errors, script errors, decoding errors) |
focus
| Event
| Window , elements
| Fired at nodes gaining focus |
formdata
HTMLFormElement/formdata_event Support in all current engines. Firefox72+Safari15+Chrome77+ Opera64+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox AndroidNoSafari iOS15+Chrome Android77+WebView Android77+Samsung Internet12.0+Opera Android55+ | FormDataEvent
| form elements
| Fired at a form element when it is constructing the entry list
|
hashchange
Support in all current engines. Firefox3.6+Safari5+Chrome8+ Opera10.6+Edge79+ Edge (Legacy)12+Internet Explorer8+ Firefox Android4+Safari iOS5+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android11+ | HashChangeEvent
| Window
| Fired at the Window when the fragment part of the document's URL changes
|
input
Support in all current engines. Firefox6+Safari3.1+Chrome1+ Opera11.6+Edge79+ Edge (Legacy)NoInternet Explorer🔰 9+ Firefox Android6+Safari iOS2+Chrome Android18+WebView Android1+Samsung Internet1.0+Opera Android12+ | Event
| Form controls | Fired at controls when the user changes the value (see also the change event)
|
invalid
HTMLInputElement/invalid_event Support in all current engines. Firefox4+Safari5+Chrome10+ Opera10+Edge79+ Edge (Legacy)12+Internet Explorer10+ Firefox Android64+Safari iOS5+Chrome Android18+WebView Android4+Samsung Internet4.0+Opera Android12+ | Event
| Form controls | Fired at controls during form validation if they do not satisfy their constraints |
languagechange
Support in all current engines. Firefox32+Safari10.1+Chrome37+ Opera24+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android4+Safari iOS10.3+Chrome Android37+WebView Android37+Samsung Internet4.0+Opera Android24+ WorkerGlobalScope/languagechange_event Support in all current engines. Firefox74+Safari4+Chrome4+ Opera11.5+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android79+Safari iOS5+Chrome Android40+WebView Android37+Samsung Internet4.0+Opera Android27+ | Event
| Global scope objects | Fired at the global scope object when the user's preferred languages change |
load
| Event
| Window , elements
| Fired at the Window when the document has finished loading; fired at an element containing a resource (e.g. img , embed ) when its resource has finished loading
|
message
BroadcastChannel/message_event Support in all current engines. Firefox38+Safari15.4+Chrome54+ Opera41+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android38+Safari iOS15.4+Chrome Android54+WebView Android54+Samsung Internet6.0+Opera Android41+ DedicatedWorkerGlobalScope/message_event Support in all current engines. Firefox3.5+Safari4+Chrome4+ Opera10.6+Edge79+ Edge (Legacy)12+Internet Explorer10+ Firefox Android4+Safari iOS5+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android11.5+ Support in all current engines. Firefox6+Safari5+Chrome6+ Opera12+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android45+Safari iOS5+Chrome Android18+WebView Android4.4+Samsung Internet1.0+Opera Android12+ Support in all current engines. Firefox41+Safari5+Chrome1+ Opera10.6+Edge79+ Edge (Legacy)12+Internet Explorer10+ Firefox Android41+Safari iOS4.2+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android11.5+ Support in all current engines. Firefox9+Safari4+Chrome60+ Opera47+Edge79+ Edge (Legacy)12+Internet Explorer8+ Firefox Android9+Safari iOS4+Chrome Android60+WebView Android60+Samsung Internet8.0+Opera Android47+ Support in all current engines. Firefox3.5+Safari4+Chrome4+ Opera10.6+Edge79+ Edge (Legacy)12+Internet Explorer10+ Firefox Android4+Safari iOS5+Chrome Android18+WebView Android4.4+Samsung Internet1.0+Opera Android11.5+ | MessageEvent
| Window , EventSource , WebSocket , MessagePort , BroadcastChannel , DedicatedWorkerGlobalScope , Worker , ServiceWorkerContainer
| Fired at an object when it receives a message |
messageerror
BroadcastChannel/messageerror_event Support in all current engines. Firefox57+Safari15.4+Chrome60+ Opera47+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android57+Safari iOS15.4+Chrome Android60+WebView Android60+Samsung Internet8.0+Opera Android47+ DedicatedWorkerGlobalScope/messageerror_event Firefox57+SafariNoChrome60+ Opera47+Edge79+ Edge (Legacy)18Internet ExplorerNo Firefox Android57+Safari iOSNoChrome Android60+WebView Android60+Samsung Internet8.0+Opera Android47+ MessagePort/messageerror_event Firefox57+SafariNoChrome60+ Opera47+Edge79+ Edge (Legacy)18Internet ExplorerNo Firefox Android57+Safari iOSNoChrome Android60+WebView Android60+Samsung Internet8.0+Opera Android47+ Firefox57+SafariNoChrome60+ Opera47+Edge79+ Edge (Legacy)18Internet ExplorerNo Firefox Android57+Safari iOSNoChrome Android60+WebView Android60+Samsung Internet8.0+Opera Android47+ Firefox57+SafariNoChrome60+ Opera47+Edge79+ Edge (Legacy)18Internet ExplorerNo Firefox Android57+Safari iOSNoChrome Android60+WebView Android60+Samsung Internet8.0+Opera Android47+ | MessageEvent
| Window , MessagePort , BroadcastChannel , DedicatedWorkerGlobalScope , Worker , ServiceWorkerContainer
| Fired at an object when it receives a message that cannot be deserialized |
offline
Support in all current engines. Firefox9+Safari4+Chrome3+ Opera15+Edge79+ Edge (Legacy)12+Internet Explorer9+ Firefox Android9+Safari iOS3+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android14+ | Event
| Global scope objects | Fired at the global scope object when the network connections fails |
online
Support in all current engines. Firefox9+Safari4+Chrome3+ Opera15+Edge79+ Edge (Legacy)12+Internet Explorer9+ Firefox Android9+Safari iOS3+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android14+ | Event
| Global scope objects | Fired at the global scope object when the network connections returns |
open
Support in all current engines. Firefox6+Safari5+Chrome6+ Opera12+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android45+Safari iOS5+Chrome Android18+WebView Android4.4+Samsung Internet1.0+Opera Android12+ | Event
| EventSource , WebSocket
| Fired at networking-related objects when a connection is established |
pagehide
Support in all current engines. Firefox6+Safari5+Chrome3+ Opera15+Edge79+ Edge (Legacy)12+Internet Explorer11 Firefox Android6+Safari iOS4.2+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android14+ | PageTransitionEvent
| Window
| Fired at the Window when the page's entry in the session history stops being the current entry
|
pageshow
Support in all current engines. Firefox6+Safari5+Chrome3+ Opera15+Edge79+ Edge (Legacy)12+Internet Explorer11 Firefox Android6+Safari iOS4.2+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android14+ | PageTransitionEvent
| Window
| Fired at the Window when the page's entry in the session history becomes the current entry
|
paste
| Event
| Elements | Fired at elements when the user will insert the clipboard data in the most suitable format (if any) supported for the given context |
popstate
Support in all current engines. Firefox4+Safari5+Chrome5+ Opera11.5+Edge79+ Edge (Legacy)12+Internet Explorer10+ Firefox Android4+Safari iOS4.2+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android11.5+ | PopStateEvent
| Window
| Fired at the Window when the user navigates the session history
|
readystatechange
Document/readystatechange_event Support in all current engines. Firefox4+Safari5.1+Chrome9+ Opera12.1+Edge79+ Edge (Legacy)12+Internet Explorer4+ Firefox Android4+Safari iOS5+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android12.1+ | Event
| Document
| Fired at the Document when it finishes parsing and again when all its subresources have finished loading
|
rejectionhandled
| PromiseRejectionEvent
| Global scope objects | Fired at global scope objects when a previously-unhandled promise rejection becomes handled |
reset
Support in all current engines. Firefox6+Safari3+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)12+Internet Explorer9+ Firefox Android6+Safari iOS1+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android12.1+ | Event
| form elements
| Fired at a form element when it is reset
|
securitypolicyviolation
| Event
| Elements | Fired at elements when a Content Security Policy violation is generated [CSP] |
select
| Event
| Form controls | Fired at form controls when their text selection is adjusted (whether by an API or by the user) |
slotchange
HTMLSlotElement/slotchange_event Support in all current engines. Firefox63+Safari10.1+Chrome53+ Opera40+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android63+Safari iOS10.3+Chrome Android53+WebView Android53+Samsung Internet6.0+Opera Android41+ | Event
| slot elements
| Fired at slot elements when their assigned nodes change
|
storage
Support in all current engines. Firefox45+Safari4+Chrome1+ Opera15+Edge79+ Edge (Legacy)15+Internet Explorer9+ Firefox Android45+Safari iOS4+Chrome Android18+WebView Android37+Samsung Internet1.0+Opera Android14+ | StorageEvent
| Window
| Fired at Window event when the corresponding localStorage or sessionStorage storage areas change
|
submit
Support in all current engines. Firefox1+Safari3+Chrome1+ Opera8+Edge79+ Edge (Legacy)12+Internet Explorer9+ Firefox Android4+Safari iOS1+Chrome Android18+WebView Android1+Samsung Internet1.0+Opera Android10.1+ | Event
| form elements
| Fired at a form element when it is submitted
|
toggle
HTMLDetailsElement/toggle_event Support in all current engines. Firefox49+Safari10.1+Chrome36+ Opera23+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android49+Safari iOS10.3+Chrome Android36+WebView Android37+Samsung Internet3.0+Opera Android24+ | Event
| details element
| Fired at details elements when they open or close
|
unhandledrejection
Window/unhandledrejection_event Support in all current engines. Firefox69+Safari11+Chrome49+ Opera36+Edge79+ Edge (Legacy)NoInternet ExplorerNo Firefox Android79+Safari iOS11.3+Chrome Android49+WebView Android49+Samsung Internet5.0+Opera Android36+ | PromiseRejectionEvent
| Global scope objects | Fired at global scope objects when a promise rejection goes unhandled |
unload
Support in all current engines. Firefox1+Safari3+Chrome1+ Opera4+Edge79+ Edge (Legacy)12+Internet Explorer4+ Firefox Android4+Safari iOS1+Chrome Android18+WebView Android1+Samsung Internet1.0+Opera Android10.1+ | Event
| Window
| Fired at the Window object when the page is going away
|
See also media element events, application cache events, and drag-and-drop events.
This section is non-normative.
本规范中提到了以下 MIME 类型:
application/atom+xml
application/ecmascript
application/javascript
application/json
application/x-ecmascript
application/x-javascript
application/octet-stream
application/microdata+json
application/rss+xml
application/x-www-form-urlencoded
application/xhtml+xml
application/xml
image/gif
image/jpeg
image/png
image/svg+xml
multipart/form-data
multipart/mixed
multipart/x-mixed-replace
text/cache-manifest
text/css
text/ecmascript
text/event-stream
text/javascript
text/javascript1.0
text/javascript1.1
text/javascript1.2
text/javascript1.3
text/javascript1.4
text/javascript1.5
text/jscript
text/json
text/livescript
text/plain
text/html
text/ping
text/uri-list
text/vcard
text/vtt
text/x-ecmascript
text/x-javascript
text/xml
video/mp4
video/mpeg