12.9 The event ObjectEvent 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.
Example 12.22<html><head><title>Event Properties</title> </head> <body bgcolor="yellow" <font face = "verdana"> <!--Internet Explorer has src.Element property--> <!--Netscape has target property--> 1 <form name="form1" 2 onSubmit="alert(event.type + ' ' + event.srcElement);"> 3 <input type=button name="mybutton" value="Click here" 4 onClick="alert(event.type + ' ' +event.target);"> <input type=submit> </form> </body> </html> EXPLANATION
|