<HTML> <head><Title>Example For event</Title></head> <body> <script language="JavaScript" for="myButton" event="onclick()">alert('button was clicked!')</script> <input type="Button" id="myButton" value="Click here to trigger event"> </body> </HTML>