Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM type Event Property

Improve Article
Save Article
  • Last Updated : 18 Jan, 2019
Improve Article
Save Article

The type event property in HTML DOM is used to return the type of the triggered event. It returns a string which represents the type of the event. The events can be keyboard events or mouse events.



Return Value: It returns a string which represents the type of event.


<!DOCTYPE html>
            HTML DOM type Event Property
        onmousedown = "event_name(event)"
        onmouseup = "event_name(event)"
        onkeydown = "event_name(event)"
        onkeyup = "event_name(event)">
        <h2>DOM type Event Property</h2
            press any key or click the mouse
            to get event name.
        <p>Triggered Event: <span id = "GFG"></span></p>
        <!-- script to display event name -->
            function event_name(event) {
                var e = event.type;
                document.getElementById("GFG").innerHTML = e;

Before Click on the button:

After click on the button:

Supported Browsers: The browsers supported by DOM type event property are listed below:

  • Opera
  • Internet Explorer 9.0
  • Google Chrome
  • Firefox
  • Apple Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!