event property (script)
Sets or retrieves an event that the script element should listen for.
Use it together with the htmlFor property that specifies the source object of the event. For a cross-browser solution use inline event attributes. See Example 2 for details.
You can find the related objects in the Supported by objects section below.
This property is read/write.
|HTML page for this property: event
String that sets or retrieves the name of the event. For a complete list of events in HTML, see the page for events.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the event attribute:
Example HTML code 2:
This example is equivalent to the previous one, but it uses inline event handling to listen the event:
Example HTML code 3:
This example shows how to change the registered event type to another:
User Contributed Comments