type Event Attribute
Event Object
Definition and Usage
The type event attribute returns the type of the triggered event.
Syntax
Example
Example
The following example returns the type of event that was triggered:
<html>
<head>
<script>
function getEventType(event)
{
alert(event.type);
}
</script>
</head>
<body onmousedown="getEventType(event)">
<p>Click somewhere in the document.
An alert box will tell what event
type you triggered.</p>
</body>
</html>
Try it yourself »
Event Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]