!

Dette materialet blir ikke lenger vedlikeholdt. Du vil finne oppdatert materiale på siden: http://borres.hiof.no/wep/

HTML5
events
javascript
Børre Stenseth
HTML > HTML5 >Events

Events

Hva
Oversikt over events

HTML5 introduserer en rekke nye event, noen er allmene og noen er spesielle for spesielle elementer.

Window Event Attributes
Events triggered for the window object.
Applies to the <body> tag:
onafterprint,onbeforeprint,onbeforeonload,onblur,onerror,onfocus,onhaschange,onload,onmessage,onoffline,
ononline,onpagehide,onpageshow,onpopstate,onredo,onresize,onstorage,onundo,onunload
Form Events
Events triggered by actions inside a HTML form.
Applies to all HTML5 elements, but is most common in form elements
onblur,onchange,oncontextmenu,onfocus,onformchange,onforminput,oninput,
oninvalid,onselectonsubmit
Keyboard Events
Events triggered by a keyboard.
Applies to all HTML5 elements.
onkeydown,onkeypress,onkeyup
Mouse Events
Events triggered by a mouse, or similar user actions
Applies to all HTML5 elements.
onclick,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,
onmousedown,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onscroll
Media Events
Events triggered by medias like videos, images and audio.
Applies to all HTML5 elements, but is most common in media elements, such as audio, embed, img, object, and video
onabort,oncanplay,oncanplaythrough,ondurationchange,onemptied,onended,onerror,onloadeddata,
onloadedmetadata,onloadstart,onpause,onplay,onplaying,onprogress,onratechange,onreadystatechange,
onseeked,onseeking,onstalled,onsuspend,ontimeupdate,onvolumechange,onwaiting
Play/Pause http://www.it.hiof.no/~borres/dw/ht5/events/demo1.html

En inspektør

En enkel vevside som inspiserer noen elementer av uilk type/>

En utbyggbar inspektør http://www.it.hiof.no/~borres/dw/ht5/events/propdemo.html

Referanser
Vedlikehold
B Stenseth, april 2011
( Velkommen ) HTML > HTML5 >Events ( Object/Embed )