type event property
Event Object
Definition and Usage
The type event property returns the type of event that occurred, that is, the name of the event represented by the current Event object.
It has the same name as the registered event handler, or is the event handler property with the "on" prefix removed, such as "submit", "load", or "click".
Syntax
event.type
Example
Example
The following example returns the type of event that was triggered:
Click somewhere in the document. A message box will indicate the type of event you triggered.
Try it »
Event Object