This article is in need of a technical review.

Returns a string containing the type of event.

The event argument of EventTarget.addEventListener() and EventTarget.removeEventListener() is case insensitive.

For a list of available event types, see Mozilla event reference

Syntax

event.type

Examples

var string = event.type;
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">

    <title>Event.type Example</title>

    <script>
        var currEvent = null;

        function getEvtType(evt) {
            console.log("//Start------------getEvtType(evt)------------ ");

            currEvent = evt.type;
            console.log(currEvent);

            //document.getElementById("Etype").firstChild.nodeValue = currEvent;
            document.getElementById("Etype").innerHTML = currEvent;

            console.log("//End--------------getEvtType(evt)------------ ");
        }

        //Keyboard events
        document.addEventListener("keypress", getEvtType, false); //[second]  

        document.addEventListener("keydown", getEvtType, false); //first
        document.addEventListener("keyup", getEvtType, false); //third

        //Mouse events
        document.addEventListener("click", getEvtType, false); // third

        document.addEventListener("mousedown", getEvtType, false); //first
        document.addEventListener("mouseup", getEvtType, false); //second

    </script>
</head>

<body>

    <p>Press any key or click the mouse to get the event type.</p>
    <p>Event type: <span id="Etype" style="color:red">-</span></p>

</body>
</html>

Specification