The events are listed in the form on<eventName>, which is how events are used as attributes on XUL elements. The attribute contains lines of script or a function call, when a script is too long. Here is an example of an event attribute that carries out a function each time a menulist value changes:
<menulist id="eventList" editable="true" flex="1" onchange="addEvent(this)">
The syntax is different in XBL. Here the event is specified as the value of the name attribute, which is attached to the handler element. One or more of these elements can optionally be contained in a binding. The given value is the event's name, minus the "on" prefix. The executed code is contained in the body of the handler inline, or in the action attribute, as shown in this example:
<handler name="focus" action="this.activate( )"/>
Chapter 7 provides a closer look at events in XBL. All the events listed here are available for use in XUL and XBL.