mozilla

Event.detail

Summary

Returns additional numerical information about the event, depending on the type of event. See the Notes section for details.

Syntax

event.detail

Examples

var number = event.detail;
<html>
<head>
  <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;   
  }
  </script>
</head>
<body onload="init();">
<form>
 <input id="b" type="button" value="details">
 <input id="t" type="text" value=""><br>
 <input type="reset">
</form>
</body>
</html>

Notes

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.

Specification

DOM Level 2 Events: UIEvent.detail

Document Tags and Contributors

Last updated by: fscholz,