Events

Introduction

An event is an action that can happen. The following is the code for some events.

<input type="button" value="Click Here" onAbort="alert('onAbort')" onBlur="alert('onBlur')" onchange="alert('Change')" onclick="alert('onclick')" onDblClick="alert('DblClick')" onDragDrop="alert('DragDrop')" onError="alert('Error')" onFocus="alert('onFocus')" onKeyDown="alert('onKeyDown')" onKeyPress="alert('onKeyPress')" onKeyUp="alert('KeyUp')" onload="alert('Load')" onMouseDown="alert('MouseDown')" onMouseMove="alert('MouseMove')" onMouseOut="alert('onMouseOut')" onMouseOver="alert('onMouseOver')" onMouseUp="alert('MouseUp')" onMove="alert('Move')" onReset="alert('Reset')" onResize="alert('Resize')" onSelect="alert('Select')" onsubmit="alert('onsubmit')" onunload="alert('onunload')"></input>

User Events

Example

The following code shows the HTML for a button click.

<input type="button" value="Click Here" onclick="alert('You clicked the button.')"> </input>