...

Web Technologies - HTML5

Back to Course

Lesson Description


Lession - #546 HTML5 Events


An event refers to an action or occurrence that happens within the system you're programming. The system then notifies you about the event so that you'll be able to respond to it in a way if necessary. in this article, i'll focus on events within the context of web browsers.

We can write our event handlers in Javascript or VBscript and you'll be able to specify these event handlers as a value of event tag attribute. The HTML5 specification defines varied event attributes as listed below −

We can use the following set of attributes to trigger any javascript or vbscript code given as worth, once there's any event that takes place for any HTML5 component.

offline script
Triggers once the document goes offline

onabort script
Triggers on an abort event

onafterprint script
Triggers when the document is printed

onbeforeonload script
Triggers before the document loads

onbeforeprint script
Triggers before the document is written

onblur script
Triggers once the window loses focus

oncanplay script
Triggers once media will start play, however would possibly has got to stop for buffering

oncanplaythrough script
Triggers once media are often played to the end, no end for buffering

onchange script
Triggers once a part changes

onclick script
Triggers on a depression

oncontextmenu script
Triggers once a context menu is triggered

ondblclick script
Triggers on a mouse double-click

ondrag script
Triggers when an element is dragged

ondragend script
Triggers at the end of a drag operation

ondragenter script
Triggers once an element has been dragged to a valid drop target

ondragleave script
Triggers once a part leaves a valid drop target

ondragover script
Triggers once an element is being dragged over a valid drop target

ondragstart script
Triggers at the start of a drag operation

ondrop script
Triggers when dragged component is being dropped

ondurationchange script
Triggers when the length of the media is changed

onemptied script
Triggers once a media resource component suddenly becomes empty.

onended script
Triggers once media has reach the end

onerror script
Triggers once an error occur

onfocus script
Triggers once the window gets focus

onformchange script
Triggers once a kind changes

onforminput script
Triggers once a kind gets user input

onhaschange script
Triggers once the document has change

oninput script
Triggers once a part gets user input

oninvalid script
Triggers once a part is invalid

onkeydown script
Triggers once a key is pressed

onkeypress script
Triggers once a key is pressed and released

onkeyup script
Triggers once a key is released

onload script
Triggers when the document loads

onloadeddata script
Triggers once media data is loaded

onloadedmetadata script
Triggers when the period and other media data of a media component is loaded

onloadstart script
Triggers once the browser starts to load the media information

onmessage script
Triggers once the message is triggered

onmousedown script
Triggers once a button is pressed

onmousemove script
Triggers once the mouse pointer moves

onmouseout script
Triggers once the mouse pointer moves out of an element

onmouseover script
Triggers once the mouse pointer moves over an element

onmouseup script
Triggers once a mouse button is released

onmousewheel script
Triggers once the mouse wheel is being rotated

onoffline script
Triggers once the document goes offline

online script
Triggers once the document comes online

ononline script
Triggers once the document comes on-line

onpagehide script
Triggers once the window is hidden

onpageshow script
Triggers once the window becomes visible

onpause script
Triggers once media data is paused

onplay script
Triggers once media information is going to start playing

onplaying script
Triggers once media data has begin playing

onpopstate script
Triggers once the window's history changes
onprogress script
Triggers once the browser is fetching the media data

onratechange script
Triggers once the media data's playing rate has changed

onreadystatechange script
Triggers when the ready-state changes

onredo script
Triggers once the document performs a redo

onresize script
Triggers when the window is resized

onscroll script
Triggers once an element's scrollbar is being scrolled

onseeked script
Triggers once a media element's seeking attribute is no longer true, and the seeking has ended

onseeking script
Triggers once a media element's seeking attribute is true, and the seeking has begun

onselect script
Triggers once an element is selected

onstalled script
Triggers once there's an error in fetching media data

onstorage script
Triggers once a document loads

onsubmit script
Triggers once a form is submitted

onsuspend script
Triggers when the browser has been fetching media information, however stopped before the whole media file was fetched

ontimeupdate script
Triggers once media changes its enjoying position

onundo script
Triggers once a document performs AN undo

onunload script
Triggers once the user leaves the document

onvolumechange script
Triggers once media changes the degree, additionally once volume is ready to "mute"

onwaiting script
Triggers once media has stopped enjoying, however is predicted to resume