<html>
<head>
<title> Using the handleEvent method of the Form object</title>
</head>
<body>
<script language = "JavaScript">
<!--
function handleMyClick(evnt){
window.document.button1.handleEvent(evnt);
}
function displayMsg(){
document.form1.msg.value += "Click event occurred.\n";
}
document.onclick = handleMyClick;
-->
</script>
<form name="form1">
<input type="button" value="Click on Me" name="button1" onClick='displayMsg()'>
<br><br>
<textarea name="msg" rows="10" cols="50" onClick='displayMsg()'></textarea>
</form>
</body>
</html>
|