• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Handling Events > The event Object

12.9. The event Object

Event objects are sent to an event handler with each event that occurs within a document. The object provides information about the event, described by its many properties, but is implemented differently in Netscape Navigator and in IE. Table 12.7 provides a list of the properties for Netscape Navigator and Internet Explorer.

Table 12.7. Properties of the event object.
PropertyWhat It Describes
altKey, ctrlKey, shiftKeySet to true or false to test if Alt, Shift, or Control keys were pressed when the event occurred (IE)
buttonThe mouse button that was pressed (IE)
cancelBubbleSet to true or false to cancel or enable event bubbling
clientX and clientYThe cursor's horizontal and vertical position in pixels, relative to the Web page in which the event occurred (IE)
dataArray of URLs for dragged and dropped (NN)
fromElement and toElementThe HTML element being moved to or from (IE)
height and widthHeight and width of the window (NN)
keyCodeThe Unicode key code associated with a keypress event (IE)
layerX and layerYHorizontal and vertical cursor position within a layer (NN)
modifiersThe bitmask representing modifier keys such as Alt, Shift, Meta, etc. (NN)
offsetX and offsetYThe cursor's horizontal and vertical position in pixels, relative to the container in which the event occurred (IE)
pageX and pageYHorizontal and vertical cursor position within a Web page (NN)
reasonUsed to indicate the status of a data transfer for data source objects (IE)
returnValueThe return value of the event handler, either true or false (IE)
screenX and screenYHorizontal and vertical cursor position within a screen (NN)
srcElementSame as target for IE
srcFilterSpecifies the filter object that caused an onfilterchange event (IE only)
targetObject for captured events (NN)
typeThe type of event that occurred (NN)
whichA numeric value for the mouse button that was pressed or the ASCII value of a pressed key (NN)
x and yThe cursor's horizonal and vertical position in pixels, relative to the document in which the event occurred (IE)



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint