Document JavaScript Tutorial

Syntax

document.captureEvents(eventMask)
The captureEvents() method specifies the type of events that should be passed to the document rather than to the object for which they were intended.
The eventMask argument(s) specifies what events to capture.
The following list shows all the possible event masks.
Multiple events can be captured by using the bitwise OR (|) operator.
Event.ABORT
Event.BLUR
Event.CHANGE
Event.CLICK
Event.DBCLICK
Event.DRAGDROP
Event.ERROR
Event.FOCUS
Event.KEYDOWN
Event.KEYPRESS
Event.KEYUP
Event.LOAD
Event.MOUSEDOWN
Event.MOUSEMOVE
Event.MOUSEOUT
Event.MOUSEOVER
Event.MOUSEUP
Event.MOVE
Event.RESET
Event.RESIZE
Event.SELECT
Event.SUBMIT
Event.UNLOAD


    

               value="Yellow/Purple"
           onMouseDown="document.bgColor='yellow'"
           onMouseUp="document.bgColor='purple'">