This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.



Gets additional, developer defined, information about an event.

Property of dom/UIEventdom/UIEvent


Note: This property is read-only.

var eventDetails = event.detail;

Return Value

Returns an object of type NumberNumber

Returns additional numerical information about the event, depending on the type of event.


<!DOCTYPE html>
  <title>event.detail example</title>
  <script type="text/javascript">
  function giveDetails(e) {
      var text = document.getElementById("t");
      text.value = e.detail;
  function init() {
      var b1 = document.getElementById("b");
      b1.onclick = giveDetails;
<body onload="init();">
 <input id="b" type="button" value="details"/>
 <input id="t" type="text" value=""/><br/>
 <input type="reset"/>


 Use this property to get developer defined information about a developer generated event, if any. When part of a user agent initiated UIEvent, this property is never set.


You can set the detail property of an event by using the initUIEvent method.

For mouse events, such as click, dblclick, mousedown, or mouseup, the detail property indicates how many times the mouse has been clicked in the same location for this event.

For a dblclick event the value of detail is always 2.

Related specifications

DOM Level 3 Events
Working Draft