function handlePress(evnt){ alert("You pressed a key down. The event type: " + evnt.type); return true; }
function handleDblClick(evnt){ alert("You double clicked at location: " + evnt.pageX + "," + evnt.pageY); return(true); } function handleSubmit(evnt){ alert("You clicked on the submit button"); } window.onkeypress = handlePress;
window.ondblclick = handleDblClick;
document.onsubmit = handleSubmit; -->
</script> When you click on the submit button, it triggers the <b>SUBMIT</b> event which displays an alert box.
<br><br> If you double click somewhere in the page, it triggers the <b>DBLCLICK</b> event. <br><br> When a key is pressed down in the browser, the <b>KEYPRESS</b> event is triggered. <br><br><br> <form> <input type="submit" value="Submit" onSubmit=''> </form> </body> </html>