event.type Property - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:event.type

Description

The event.type property returns event type.

The following code shows how to Return which event type was triggered:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("p").on("click dblclick mouseover mouseout",function(event){
        $("div").html("Event: " + event.type);
    });/*from  w w  w .j  av  a 2  s .co  m*/
});
</script>
</head>
<body>

<p>This paragraph has a click, double-click, mouseover and mouseout event defined.<br/>
</p>

<div />

</body>
</html>

Related Tutorials