Favorites

DOM Event.type Property

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Event.type
DOM Event PropertyThis property is supported by all modern browsers.
Updated 28th November 2026

The type property of an event gives its name, such as click, input or keydown.

Description

The read-only type property contains the name of the event, the same string used with addEventListener(). It's useful when one function handles several kinds of event.

Event names are lower case for built-in events, apart from a few historical exceptions such as DOMContentLoaded. Custom events can use any string, so a consistent naming scheme helps keep them recognizable.

Checking event.type lets one handler serve related events, such as treating mouseenter and focus the same way to show a tooltip, and mouseleave and blur to hide it, which keeps behaviour consistent for mouse and keyboard users.

Syntax

event.type

Value

A string with the name of the event, such as "click".

Example

<input placeholder="Type here">
const field = document.querySelector('input');
function log(e) { console.log(e.type); }
['focus', 'input', 'blur'].forEach(t => field.addEventListener(t, log));
console.log('Click the field, type, then click away');

Browser Support

The following information will show you the current browser support for the Event.type property. Hover over a browser icon to see the version that first introduced support for this property.

This property is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee