HTML and CSS Reference
EXAMPLE 13.21 ( CONTINUED )
The HTML form starts here.
When the user clicks the first button in this form, the onClick event is triggered.
It will cause an alert message to appear displaying two event properties: the type
of the event and the HTML element where it came from ( srcElement (Internet Ex-
plorer) property of the object). The type of event is cross-browser compliant.
The input type for this form is a button. When the user clicks the button for In-
ternet Explorer, an alert box displays the type of the event and the source or object
from when it originated.
When the onClick event is triggered, an alert message will appear displaying two
event properties: the type of the event and the target (Firefox) property or object
from which the event originated. See Figures 13.30, 13.31, and 13.32. W3C and
Firefox both use the target property. Internet Explorer uses srcElement .
Figure 13.30 Displaying the event object's property in Internet Explorer (left), and
Figure 13.31 The user clicked the Firefox button.