
ONCLICK : mouse button clicked
ONDBLCLICK : mouse button double-clicked
ONMOUSEDOWN : mouse button is pressed
ONMOUSEOVER : mouse moved onto an element
ONMOUSEMOVE : mouse moved over an element
ONMOUSEOUT : mouse moved out of an element
ONMOUSEUP : mouse button is released
ONKEYPRESS : key pressed and released
ONKEYDOWN : key pressed
ONKEYUP : key released
There are two special events that are specific to body tag. Those are;
ONLOAD : document loaded completely
ONUNLOAD : document unloaded
Calling a Javascript method
At any of the above events, you can call any javascript function from your body tag. A Javascript function named testAlert() can be called as below.
<body onload="testAlert();">
To call move than one Javascript function, you have to write the function named separating by semi-colons ( ; ) as below.
<body onclick="validate(); calculate(); submit();">
No comments:
Post a Comment