Easy Tutorial
❮ Css Initial Event Ondragleave ❯

type Event Property


Definition and Usage

The type event property returns the type of the event that occurred, which is the name of the event represented by the current Event object.

It matches the name of the registered event handler, or the event handler property with the prefix "on" removed, such as "submit", "load", or "click".

Syntax


Example

Example

The following example returns the type of the event that was triggered:

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>tutorialpro.org(tutorialpro.org)</title> 
<script type="text/javascript"> 
function getEventType(event){ 
    alert(event.type); 
} 
</script> 
</head> 
<body onmousedown="getEventType(event)"> 

<p>Click somewhere in the document. A message box will show you the type of event that was triggered.</p> 

</body> 
</html>

❮ Css Initial Event Ondragleave ❯