FOLLOW US ON TWITTER



FOLLOW US



img/blogimg/html5.jpg


@coder 839

HTML Event Attributes


2021-11-17 19:49 · 15 min read

Event

Every action performed by the user and the web tool itself is termed as an Event of HTML. When an event trigger we can run javascript functions and many more. like starting JavaScript when a user clicks on an element.
An HTML event maybe something the browser does, or something a User does. Here are a few examples of HTML events: An HTML web page has completed loading. An HTML input field was changed.
Event is the action performed by the User.


Different Types of HTML Events.

  •  Windows Event Attributes: This is provided for the action of the windows object. It works in body tag  <body>.
  •  Form Event Attributes: If the user performs some action in the form like input data, cancel, submit then these event attributes works.
  •  Keyboard Event Attributes: These keyboard event attributes are is is is used for keyboard action and user interaction.
  •  Mouse Event Attributes: Mouse event attribute used for mouse action that is move, click, wheel, etc.
  •  Media Event Attributes: This event attribute works on media files like video etc.

Example:

<button style="width: 160px;background-color: rgb(255,82,82);border: none;padding: 11px 20px;color:#fff" onclick="alert('Hey you clicked me')">Click me</button>

 

Windows Event Attributes

AttributeDetails
onafterprintThis script act, though after the document is is is printed.
onbeforeprintThis script act, though before a document printed.
onbeforeunloadWhereas before the unloaded document, this Script works.
onerrorIn document occurs the Error then this event executed.
onhashchangeThe anchor part of URL change in the document that time event executed.
onloadWhen the first Web page is loaded completely then this event is executed.
onmessageIn the document, the message that occurred at that time event was executed.
onofflineIf the network connection is unavailable and the browser says offline then the event is executed.
ononlineWhen the network is available in the browser then the event is executed.
onpagehideThis script act, if the user not working on a current webpage then-current page can be hidden.
onpageshowThis script act at that time the current webpage is loaded by its users.
onpopstateThis script automatically works on the browser for a history state change.
onresizeThis script act when the browser of the window changes its size.
onstorageWhen the user's web storage is updated then the event is executed.
onunloadEither the user’s current webpage is not loaded, or the window is closed, then the event is executed.

Form Event Attributes

AttributeDetails
onblurThe onblur event occurs when an object loses focus
onchangeThe value change in the form then the is the vent fired.
onfocusIn the form <input>, <a> , <select> object has focus. Working on this object then event fired.
oninputThe user gives input of value in the form then this event is fired.
oninvalidThe event works when the element does not satisfy its predefined constraints.
onresetUser reset the form information then event fired.
onsearchUsers search the required field then event fired.
onselectThe user selects the text or text area in the form then the event is fired.
onsubmitThe user submits the form at the end then the event is fired.


 

Keyboard Event Attributes

AttributeDetails
onkeydownUsing a keyboard, the user presses the key down at that point event works
onkeypressUsing the keyboard, users press the key and display characters at that point event works.
onkeyupAfter the press, the key user releases the key then the event works.


 

Mouse Event Attributes

AttributeDetails
onclickThe user clicks the mouse on the button then an event occurred.
ondblclickUsers double-click the mouse then the event occurred.
oncontextmenuUsers right-click the mouse then the event occurred.
onmousedownThe user presses the mouse button on the element then the event occurred.
onmousemoveThe user moves the mouse pointer over the element then the event occurred.
onmouseoutThe user moves the mouse outside of the element then the event occurred.
onmouseoverThe user moves the mouse over the element then the event occurred.
onmouseupThe user released the mouse button then the event occurred.
onmousewheelUsing the mouse wheel user rolls the up and down on element then the event occurred.
onwheelUsing a mouse wheel user roll them up and down then the event occurred.



 

Media Event Attributes

AttributeDetails
onabortWhen media files are aborted for download and play again then an event occurs.
oncanplayWhen any media file is ready for play then this trigger is fired.
oncanplaythroughMedia file ready to play without buffering and loading.
oncuechangeElement changes the cue of <track> then event fired.
ondurationchangeThe Media file changes the length of time then the trigger is fired.
onemptiedIf the Media file is unavailable and comes fatal error then the trigger is fired.
onendedMedia file comes on endpoint then trigger is fired.
onerrorWhen an error occurred to get the media file then trigger is fired
onloadeddataThe Media file loads the data then the trigger is fired.
onloadedmetadataThe Media file loads the metadata then the trigger is fired.
onloadstartThe Media file starts to load then the trigger is fired.
onpauseThe Media file is paused to play again then the trigger is fired.
onplayMedia file ready to play then trigger is fired.
onplayingThe Media file starts to play when the trigger is fired.
onprogressThis script act when the browser is working on connecting with the media data.
onratechangeIf the video's playback speed is changed then the trigger is fired.
onseekedUsers completed moving otherwise skip the new position of video. this attribute is set as false.
onseekingThe user wants to move otherwise skip the new position of the video. this attribute is set as true.
onstalledWhen the browser suddenly stops the connection of data then the event works.
onsuspendWhen the web Browser on purpose does not get media data then events work.
ontimeupdateWhen a user changes the video play position like forward and backward.
onvolumechangeTo change media volume from low to high.
onwaitingIf the data load the information, the current video stop with buffering then the event works.


 

 

TAGS:






POST COMMENTS
No Comment

Please login to post comment




POPULAR POSTS

best free web hosting services...
what is new in miui 11?...
free website ssl security using cloudfla...
do you want to make money online?...
CSS3 @IMPORT RULES...
What is HTML Anchor Tag and Hyperlinks?...
How to host a web page in 10 minutes....
CSS3 RESPONSIVE UI...
Tables HTML...
CSS3 FUNCTIONS...
How to use CSS3 Overflow Property?...
CSS3 FILTERS...


RECENT COMMENTS

2022-03-05 11:05
By coder on XAMPP - MySQL shutdown unexpectedly | How to fix MySQL crash unexpectedly
2021-10-12 12:34
By abnongoke on do you want to make money online?
2021-10-12 12:34
By abnongoke on how to get a free website domain name?
2021-10-12 12:34
By solar panel for shed on what is new in miui 11?
2021-10-12 12:34
By solar panel for shed on best free web hosting services
2021-10-12 12:34
By amos tanui on free website ssl security using cloudflare


SOCIAL SHARE



FOLLOW US ON TWITTER



FOLLOW US ON FACEBOOK



FOLLOW US







Recent Blogs



Contact Us

Subscribe Our News-Letter



Kashipur, 244713
Uttarakhand, India



© www.prodevskill.com 2023. All Rights Reserved. Powered by Pro Developer