HTML 5 Attribute

attributes in html

In HTML5 there are lots of HTML 5 Attribute available which can be activated using a programming language such as JavaScript.

When a browser reacts on user action, then it is called as an event. For example, when you click on the submit button, then if the browser displays an information box.


Windows Event HTML 5 Attribute:

1. onafterprint : Executed the script after the document is printed.

2. onbeforeprint : Executed the script before the document is printed.

3. onbeforeunload : Executed the script before a document being unloaded.

4. onerror : Executed the script when an error occurs.

5. onhashchange : Executed the script when the anchor part in URL of the webpage is changed.

6. onload : Executed the script when the webpage is entirely loaded.

7. onmessage : Executed the script when a message event occurs.

8. onoffline : Executed the script when the network connection is disconnected, and browser started working offline.

9. ononline : Executed the script when the browser started working online.

10. onpagehide : Executed the script when the current webpage is hidden such as if the user has moved away from the current webpage.

11. onpageshow : Executed the script when the current webpage is focused.

12. onpopstate : Executed the script when the window’s active history is changed.

13 onresize : Executed the script when the window is resized.

14. onstorage : Executed the script when web storage is updated.

15. onunload : Executed the script when the current webpage is unloaded, or window is closed.


Form Event HTML 5 Attribute :

a. onblur : Executed the script when form element loses the focus.

b. onchange : Executed the script when the value of the element is changed.

c. onfocus : Trigger an event when the element gets focused.

d. oninput : Executed the script when the user enters input to the element.

e. oninvalid : Executed the script when the element does not satisfy its predefined constraints.

f. onreset : Triggers the event when user reset the form element values.

g. onsearch : Triggers the event when a search field receives some input.

h. onselect : Triggers the event when the user has selected some text.

i. onsubmit : Triggers the event when a form is submitted.


Keyboard Event Attributes:

i. onkeydown : Triggers the event when the user presses down a key on the keyboard.

ii. onkeypress : Trigger the event when the user presses the key which displays some character.

iii. onkeyup : Trigger the event when the user releases the currently pressed key.


Mouse Event Attributes:

i) onclick : Trigger the event when the mouse clicks on the element.Trigger the event when the mouse clicks on the element.

ii) ondblclick : Trigger the event when mouse double-click occurs on the element.

iii) onmousedown : Trigger the event when the mouse button is pressed on the element.

iv) onmousemove : Trigger the event when the mouse pointer moves over the element.

v) onmouseout : Trigger the event when the mouse moves outside the element.

vi) onmouseover : Trigger the event when the mouse moves onto the element.

vii) onmouseup : Trigger the event when the mouse button is released.

viii) onmousewheel : Deprecated. Use the onwheel attribute.

ix) onwheel : Trigger the event when the mouse wheel rolls up or down on the element.


Clipboard Event Attributes:

i. oncopy : Trigger the event when the user copies the content to the system clipboard.

ii. oncut : Trigger the event when the content of an element is cut and copy to the clipboard.

iii. onpaste : Trigger the event when the user pastes some content in an element.


Media Event Attributes:

1. onabort : Executed the script when media playback is aborted.

2. oncanplay : Executed the script when the media file is ready to play.

3. oncanplaythrough : Executed the script when the media file is ready to play without buffering or stopping.

4. oncuechange : Executed the script text cue of <track> element is changed.

5. ondurationchange: Executed the script when the media file duration is changed.

6. onemptied : Executed the script if media occurs some fatal error, and the file becomes unavailable.

7. onended : Executed the script when the media file occurs its end point.

8. onerror : Executed the script when some error occurred while fetching the media data.

9. onloadeddata : Executed the script when media data is loaded.

10. onloadedmetadata : Executed the script when metadata of media file is loaded.

11. onloadstart : Executed the script when loading of media file starts.

12. onpause : Executed the script when media playback is paused.

13. onplay : Executed the script when media file ready to play after being paused.

14. onplaying : Executed the script when media file is started playing.

15. onprogress : Executed the script when the browser is in the process of getting the media data.

16. onratechange : Executed the script when playback speed changed.

17. onseeked : Executed the script when seek operation is ended and seeking attribute is set to false.

19. onseeking: Executed the script when seek operation is active and seeking attribute is set to true.

20. onstalled: Executed the script when browser unexpectedly stopped fetching the data media.

21. onsuspend : Executed the script if fetching of media data is intentionally stopped.

22. ontimeupdate : Executed the script when playback position is changed, such as if a user fasts forward the track.

23. onvolumechange : Executed the script when media volume is changed (muted or unmuted).

24. onwaiting : Executed the script if playback pause to wait for loading more data.


Recommended Posts:

Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *