Skip to main content

HTML5 Events


The HTML5 specification defines various event attributes as listed below:

Attribute Value Description
offlinescriptTriggers when the document goes offline
onabortscriptTriggers on an abort event
onafterprintscriptTriggers after the document is printed
onbeforeonloadscriptTriggers before the document loads
onbeforeprintscriptTriggers before the document is printed
onblurscriptTriggers when the window loses focus
oncanplayscriptTriggers when media can start play, but might has to stop for buffering
oncanplaythroughscriptTriggers when media can be played to the end, without stopping for buffering
onchangescriptTriggers when an element changes
onclickscriptTriggers on a mouse click
oncontextmenuscriptTriggers when a context menu is triggered
ondblclickscriptTriggers on a mouse double-click
ondragscriptTriggers when an element is dragged
ondragendscriptTriggers at the end of a drag operation
ondragenterscriptTriggers when an element has been dragged to a valid drop target
ondragleavescriptTriggers when an element leaves a valid drop target
ondragoverscriptTriggers when an element is being dragged over a valid drop target
ondragstartscriptTriggers at the start of a drag operation
ondropscriptTriggers when dragged element is being dropped
ondurationchangescriptTriggers when the length of the media is changed
onemptiedscriptTriggers when a media resource element suddenly becomes empty.
onendedscriptTriggers when media has reach the end
onerrorscriptTriggers when an error occur
onfocusscriptTriggers when the window gets focus
onformchangescriptTriggers when a form changes
onforminputscriptTriggers when a form gets user input
onhaschangescriptTriggers when the document has change
oninputscriptTriggers when an element gets user input
oninvalidscriptTriggers when an element is invalid
onkeydownscriptTriggers when a key is pressed
onkeypressscriptTriggers when a key is pressed and released
onkeyupscriptTriggers when a key is released
onloadscriptTriggers when the document loads
onloadeddatascriptTriggers when media data is loaded
onloadedmetadatascriptTriggers when the duration and other media data of a media element is loaded
onloadstartscriptTriggers when the browser starts to load the media data
onmessagescriptTriggers when the message is triggered
onmousedownscriptTriggers when a mouse button is pressed
onmousemovescriptTriggers when the mouse pointer moves
onmouseoutscriptTriggers when the mouse pointer moves out of an element
onmouseoverscriptTriggers when the mouse pointer moves over an element
onmouseupscriptTriggers when a mouse button is released
onmousewheelscriptTriggers when the mouse wheel is being rotated
onofflinescriptTriggers when the document goes offline
onoinescriptTriggers when the document comes online
ononlinescriptTriggers when the document comes online
onpagehidescriptTriggers when the window is hidden
onpageshowscriptTriggers when the window becomes visible
onpausescriptTriggers when media data is paused
onplayscriptTriggers when media data is going to start playing
onplayingscriptTriggers when media data has start playing
onpopstatescriptTriggers when the window's history changes
onprogressscriptTriggers when the browser is fetching the media data
onratechangescriptTriggers when the media data's playing rate has changed
onreadystatechangescriptTriggers when the ready-state changes
onredoscriptTriggers when the document performs a redo
onresizescriptTriggers when the window is resized
onscrollscriptTriggers when an element's scrollbar is being scrolled
onseekedscriptTriggers when a media element's seeking attribute is no longer true, and the seeking has ended
onseekingscriptTriggers when a media element's seeking attribute is true, and the seeking has begun
onselectscriptTriggers when an element is selected
onstalledscriptTriggers when there is an error in fetching media data
onstoragescriptTriggers when a document loads
onsubmitscriptTriggers when a form is submitted
onsuspendscriptTriggers when the browser has been fetching media data, but stopped before the entire media file was fetched
ontimeupdatescriptTriggers when media changes its playing position
onundoscriptTriggers when a document performs an undo
onunloadscriptTriggers when the user leaves the document
onvolumechangescriptTriggers when media changes the volume, also when volume is set to "mute"
onwaitingscriptTriggers when media has stopped playing, but is expected to resume

Comments

Popular posts from this blog

How to Conditionally Add Style Sheets for IE

Why use conditional stylesheets? You got problems, they need fixin' Keeps your code hack-free and valid Keeps your main stylesheet clean Perfectly acceptable technique, sanctioned by Microsoft And remember, these conditional tags don't have to be used only for CSS. You could load JavaScript, or even use them down in the content of your site to display special IE-specific messages. Target ALL VERSIONS of IE <!--[if IE]>         <link rel="stylesheet" type="text/css" href="all-ie-only.css" /> <![endif]--> Target everything EXCEPT IE <!--[if !IE]><!-->         <link rel="stylesheet" type="text/css" href="not-ie.css" />  <!--<![endif]--> Target IE 7 ONLY <!--[if IE 7]>         <link rel="stylesheet" type="text/css" href="ie7.css"> <![endif]--> Target IE 6 ONLY <!--[if IE 6]>         <link rel=&

Create progressively enhanced 3D CSS rollovers

Christian Heilmann, principal evangelist for HTML5 and the open web at Mozilla, explains how to progressively enhance CSS rollover effects into the 3D space Rollovers are a great thing. They make things more obvious that they are interactive and they allow us to show something different without giving up valuable screen estate. I remember one time when I won a pitch for my company by showing a rollover effect on a menu button. Granted, that was 1998 and nowadays we are less excited about them. This is a shame though as we have a lot more things to play with in browsers these days. Here we'll take a look at using CSS, 3D CSS transformations, transitions and CSS animations to create some great rollover styles without telling people that they need to have certain browser. Instead, we'll fall back to a plain rollover for all CSS capable browsers. For brevity's sake we won't have all browser prefixes in the code examples here, but they are in the final product