Event Examples

EVENT EXAMPLES

HTML Event Onload

<html>
<head>
<script>
function mymessage()
{alert(“This message was triggered from the onload event”);}
</script>
</head>
<body>
</body>
</html>

HTML Event Onunload

<html>
<head>
<script>
function ­mymessage()
{alert(“This message was triggered from the onunload event”);}
</script>
</head>
<body>
<p>An alert box will display a message when you close this document!</p>
</body>
</html>