onclick Event Type
This is the most frequently used event type, which occurs when a
user clicks mouse's left button. You can put your validation,
warning, etc., against this event type.
Example
<html>
<head>
<script language="vbscript" type="text/vbscript">
Function sayHello()
msgbox "Hello World"
End Function
</script>
</head>
<body>
<input type="button" onclick="sayHello()" value="Say Hello"/>
</body>
</html>
It will produce the following result, and when you click the Hello
button, the onclick event will occur which will trigger sayHello() function.
No comments:
Post a Comment