There are so many events that can be added with a webpage during execution time.You can make a function and call it upon the event in the parameter of the event handler.
I am going to represent a program which will execute a form during the selection of button-
Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function valid(form)
{
//// Codding of function...
}
</SCRIPT>
</HEAD>
<BODY >
<H3>OnClick Event Handler</H3>
Enter your name and click on the button:<BR>
<form name="myform">
<input type="text" name="data" value="" size=10>
<INPUT TYPE="button" VALUE="Click Here"
onClick="valid(this.form)">
</form>
</BODY>
</HTML>
Bookmarks