The Event object represents an event.
Properties of the Event Object is listed in the following table.
PropertyDescription
dataArray of URL's for dragged and dropped objects
heightHeight of window
layerXHorizontal cursor position within layer
layerYVertical cursor position within layer
modifiersBit mask representing modifier keys
pageXHorizontal cursor position within Web page
pageYVertical cursor position within Web page
screenXHorizontal cursor position within computer screen
screenYVertical cursor position within computer screen
targetObject for captured events
typeType of event
whichThe mouse button that is pressed
widthWidth of window
In addition to the Event properties, events exist that get handled.
The available events are shown in the following Table.
EventsDescription
ABORTLoading of Web page interrupted by user.
BLURFocus is removed from the object.
CHANGEContents or setting for document object changed.
CLICKMouse button is clicked once.
DBLCLICKMouse button is clicked twice.
DRAGDROPObject is dragged and dropped.
ERRORError occurred during loading.
FOCUSFocus is applied to an object.
KEYDOWNA key is pressed down.
KEYPRESSA key is pressed.
KEYUPA key is let up after being pressed down.
LOADLoad document within a browser.
MOUSEDOWNThe mouse button is pressed down.
MOUSEMOVEThe mouse cursor is moved.
MOUSEOUTThe mouse cursor is moved away from a specific object.
MOUSEOVERThe mouse cursor is moved over a specific object.
MOUSEUPThe pressed mouse button is let up.
MOVEObject is moved on the screen.
RESETReset button is pressed.
RESIZEWindow or frame has been resized.
SELECTDocument object is selected.
SUBMITSubmit button is pressed.
UNLOADDocument is unloaded from browser.
Using the event object
When you click on the submit button, it triggers the SUBMIT
event which displays an alert box.
If you double click somewhere in the page, it triggers the
DBLCLICK event.
When a key is pressed down in the browser, the KEYPRESS
event is triggered.