|
Help
CodingForums Partners
This is a
![]() |
Understanding "event handlers" in JavaScriptname_of_handler="JavaScript code here" For example: <a href="http://google.com" onClick="alert('hello!')">Google</a>
Different event handlers with with different HTML tags. For example, while "onclick" can be inserted into most HTML tags to respond to that tag's onclick action, something like "onload" (see below) only works inside the <body> and <img> tags. Below are some of the most commonly used event handlers supported by JavaScript:
|
| onclick: | Use this to invoke JavaScript upon clicking (a link, or form boxes) | |
| onload: | Use this to invoke JavaScript after the page or an image has finished loading. | |
| onmouseover: | Use this to invoke JavaScript if the mouse passes by some link | |
| onmouseout: | Use this to invoke JavaScript if the mouse goes pass some link | |
| onunload: | Use this to invoke JavaScript right after someone leaves this page. |