In programming, an event is an action that occurs as a result of the user or another source, such as a mouse being clicked or a key being pressed. An event handler is a routine that is used to handle the event, allowing a programmer to write code that will be executed when the event occurs.
<form action="#" method="post">
<input type="button" value="Click for a Message" onclick="window.alert('Hello!');">
Also see: Programming definitions