Event Attributes
Here we are going to list some event attributes within different subheadings which shows you that what type of event attributes are used within which html tag. So take a look-
<body> and <frameset> Events-
These attributes are normally used for <body> and <frameset> elements.
Attribute | Description |
---|---|
onload | In this case the script runs when the document take load |
onunload | In this case the script runs when the document unload |
<form> Events-
These attributes are normally used for <form> elements.
Attribute | Description |
---|---|
onblur | In this case the script runs when an element loses focus |
onchange | In this case the script runs when an element get change |
onfocus | In this case the script runs when the element gets focus |
onreset | In this case the script runs when the form is reset |
onselect | In this case the script runs when the element is selected |
onsubmit | In this case the script runs when the form is submitted |
Image Events-
The given attribute is normally used for <img> element.
Attribute | Description |
---|---|
onabort | In this case the script runs when loading of an image is interrupted |
Keyboard Events-
These attributes are normally used for all the elements except the <base>, <bdo>, <br>, <frame>, <frameset>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style >and <title> elements.
Attribute | Description |
---|---|
onkeydown | In this case the script runs when the key is pressed |
onkeypress | In this case the script runs when the key is pressed and released |
onkeyup | In this case the script runs when the key is released |
Mouse Events-
These attributes are normally used for all the elements except the <base>, <bdo>, <br>, <frame>, <frameset>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style >and <title> elements.
Attribute | Description |
---|---|
onclick | In this case the script runs on the mouse click |
ondblclick | In this case the script runs on the mouse double click |
onmousedown | In this case the script runs when the mouse button is pressed |
onmousemove | In this case the script runs when the mouse pointer moves |
onmouseout | In this case the script runs when the mouse pointer moves out of the element |
onmouseover | In this case |