• English (United States)
    • العربية (مصر)
    • Deutsch (Deutschland)
    • Español (España, alfabetización internacional)
    • français (France)
    • हिंदी (भारत)
    • italiano (Italia)
    • 日本語 (日本)
    • 한국어 (대한민국)
    • Nederlands (Nederland)
    • polski (Polska)
    • русский (Россия)
    • ไทย (ไทย)
    • Türkçe (Türkiye)
    • Tiếng Việt (Việt Nam)
    • 中文(中华人民共和国)
    • 中文(香港特別行政區)
DotNetAge - Mvc & jQuery CMS
Hide sidebar

HTML5 Events


When a user visit your website, they do things like click on text and images and given links, hover over things etc. These are examples of what JavaScript calls events.

We can write our event handlers in Javascript or vbscript and you can specify these event handlers as a value of event tag attribute. The HTML5 specification defines various event attributes as listed below:

There are following attributes which can be used to trigger any javascript or vbscript code given as value, when there is any event occurs for any HTM5 element.

We would cover element specific events while discussing those elements in detail in subsequent chapters.
Attribute Value Description
ffline script Triggers when the document goes offline
nabort script Triggers on an abort event
nafterprint script Triggers after the document is printed
nbeforeonload script Triggers before the document loads
nbeforeprint script Triggers before the document is printed
nblur script Triggers when the window loses focus
ncanplay script Triggers when media can start play, but might has to stop for buffering
ncanplaythrough script Triggers when media can be played to the end, without stopping for buffering
nchange script Triggers when an element changes
nclick script Triggers on a mouse click
ncontextmenu script Triggers when a context menu is triggered
ndblclick script Triggers on a mouse double-click
ndrag script Triggers when an element is dragged
ndragend script Triggers at the end of a drag operation
ndragenter script Triggers when an element has been dragged to a valid drop target
ndragleave script Triggers when an element leaves a valid drop target
ndragover script Triggers when an element is being dragged over a valid drop target
ndragstart script Triggers at the start of a drag operation
ndrop script Triggers when dragged element is being dropped
ndurationchange script Triggers when the length of the media is changed
nemptied script Triggers when a media resource element suddenly becomes empty.
nended script Triggers when media has reach the end
nerror script Triggers when an error occur
nfocus script Triggers when the window gets focus
nformchange script Triggers when a form changes
nforminput script Triggers when a form gets user input
nhaschange script Triggers when the document has change
ninput script Triggers when an element gets user input
ninvalid script Triggers when an element is invalid
nkeydown script Triggers when a key is pressed
nkeypress script Triggers when a key is pressed and released
nkeyup script Triggers when a key is released
nload script Triggers when the document loads
nloadeddata script Triggers when media data is loaded
nloadedmetadata script Triggers when the duration and other media data of a media element is loaded
nloadstart script Triggers when the browser starts to load the media data
nmessage script Triggers when the message is triggered
nmousedown script Triggers when a mouse button is pressed
nmousemove script Triggers when the mouse pointer moves
nmouseout script Triggers when the mouse pointer moves out of an element
nmouseover script Triggers when the mouse pointer moves over an element
nmouseup script Triggers when a mouse button is released
nmousewheel script Triggers when the mouse wheel is being rotated
noffline script Triggers when the document goes offline
noine script Triggers when the document comes online
nonline script Triggers when the document comes online
npagehide script Triggers when the window is hidden
npageshow script Triggers when the window becomes visible
npause script Triggers when media data is paused
nplay script Triggers when media data is going to start playing
nplaying script Triggers when media data has start playing
npopstate script Triggers when the window's history changes
nprogress script Triggers when the browser is fetching the media data
nratechange script Triggers when the media data's playing rate has changed
nreadystatechange script Triggers when the ready-state changes
nredo script Triggers when the document performs a redo
nresize script Triggers when the window is resized
nscroll script Triggers when an element's scrollbar is being scrolled
nseeked script Triggers when a media element's seeking attribute is no longer true, and the seeking has ended
nseeking script Triggers when a media element's seeking attribute is true, and the seeking has begun
nselect script Triggers when an element is selected
nstalled script Triggers when there is an error in fetching media data
nstorage script Triggers when a document loads
nsubmit script Triggers when a form is submitted
nsuspend script Triggers when the browser has been fetching media data, but stopped before the entire media file was fetched
ntimeupdate script Triggers when media changes its playing position
nundo script Triggers when a document performs an undo
nunload script Triggers when the user leaves the document
nvolumechange script Triggers when media changes the volume, also when volume is set to "mute"
nwaiting script Triggers when media has stopped playing, but is expected to resume

 


    Average:
  • Reads
    (700)
  • (0)
  • Permalink
Previous:HTML5 Syntax
Next:HTML5 - Web Forms 2.0
Share to:

Comments (0)


  • rss
  • atom

There is no comment found in this article.

Tag cloud

Anything in here will be replaced on browsers that support the canvas element