Hello readers, Today we will discuss about the HTML5 various global event attributes , these are of various types such as window events, mouse events, form events and media events.
Whenever any user visits a website it generates any action either by clicking on the text ,. or on an image or even on the link or by just hovering over things on a webpage this all can be done by using Javascript call events.
Now we will discuss about the window events attributes in HTML5 :-
Window Events:-
- onafterprint :- This attribute defines that the script will run after when the document gets printed.
- Onbeforeprint :- This attribute defines that the script will run before the printing of the document.
- Onbeforeunload :- This attribute defines that the script will run when the document is about to unload.
- Onerror :- This attribute defines that the script will be start running whenever an error occurs.
- Onhashchange :- This attribute defines that whenever the anchor part of a URL gets change, at that time the script will start running.
- Onmessage :- This attribute represents that whenever any messgae gets triggered , the script will start running.
- Onoffline :- This attribute defines that whenever the browser start working offline , the script will start running.
- Ononline :- This attribute defines that whenever the browser start working online , the script will start running.
- Onpagehide :- This attribute defines that whenever any user will navigates away from a page , then the script will run.
- Onoageshow :- This attribute defines that whenever any user will navigates to a page , then the script will run.
- Onpopstate :- This attribute defines that whenever the history of the browser gets changed , then the script will run.
- Onresize :- This attribute defines that on resizeing the browser window , the script will start running.
Below we will discuss about the form event attributes in HTML5
Form Events :-
- Oncontextmenu :- This attribute signifies that whenever a context menu gets triggered , the script starts running.
- Oninput :- This attribute defines that whenever an element gets user input , the script will get start running.
- Oninvalid :- This attribute represents that whenever any elements is invalid , the script will start running.
- Onreset :- The script gets fires , whenever a reset form gets clicked.
Mouse Events :-
Below we will discuss about the Mouse events used in HTML5 :-
- Ondrag :- On using this attribute ,the script gets fired whenever any element is draged.
- Ondragend :- On using this attribute ,the script gets at the end of the drag operation.
- Ondragenter :-On using this attribute ,the script gets fired whenever any element has been draged to a valid drop target in a document.
- Ondragleave :-On using this attribute ,the script gets fired whenever any element leaves a valid drop target.
- Ondragover :- On using this attribute ,the script gets fired whenever an element is dragged over a valid drop target.
- Ondragstart :- On using this attribute ,the script gets fired at start of the drag operation.
- Ondrop :- On using this attribute ,the script gets fired when the dragged element is being droped at the target.
- Onscroll :- On using this attribute ,the script gets fired whenever any element's scroolbar is being scrolled.
- Onwheel :- On using this attribute ,the script gets fired whenever a mouse wheel rolls up and down over an element.
Below we will discuss about some media events attributes used in HTML5
Media Events :-
- Oncanplay :- On using this attribute ,the script gets fired whenever a file has been buffered enough for start playing.
- Onerror :- On using this attribute ,the script gets fired whenever an error occurs on loading of file.
- Onpause :- On using this attribute ,the script gets fired whenever media is paused either by the user or due to some programatic error.
- Onplay :- On using this attribute ,the script gets fired whenever the media is ready for playing.
- Onvolumechange :- On using this attribute ,the script gets fired each time when the volume gets changed.
- Onprogress :- On using this attribute ,the script gets fired when the browser is in the process from fetching the media data.
- Ondurationchange :- On using this attribute ,the script gets fired whenever the change in the lenght of the media occurs.
Conclusion :-
Hence, it was an overview of various global events used in html5 that help the user to create an effective website using these events attributes.
Note :- HTML5 attributes works on the browsers such as on Firefox 7.0.1, Chrome 15.0, Internet Explorer 9.0 , Safari 5.1.1
0 Comment(s)