Search w3schools.com:

SHARE THIS PAGE

type Event Attribute

Event Object Reference Event Object

Definition and Usage

The type event attribute returns the type of the triggered event.

Syntax

event.type


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 Reference Event Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]