An event is defined as an item that fires based on action.
1. Create FireMsg method in the script tag based on the technical requirement.
Here we need to place the code related to the action that is performed when a button is clicked
In this case we are just trying to fire a message in alert box. You may try for user Id and password validation as an assignment
2. Assign this method in onclick event of the button.
<input type="button" value="Click Me!" onclick="FireMsg()"><br />
The way it executes is simple and straight forward. When user clicks on button it fires the corresponding event and the functionality related to that event is executed. So simple !!
Previous Chapter: Math Object - Example
More Tutorials: Tutorial Index