X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

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]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook