I handle the click event on a button and when clicking it the e.detail = 0, when I hit enter inside a textbox and for some reason the button click gets triggered (asp.net) e.detail = 1.
I couldn't find this in the jQuery documentation, it's just written that it is there but it doesn't say what it does.
Event Properties
The following properties are guaranteed to be members of the event object, though some of their values may be undefined, depending on the event:
altKey, attrChange, attrName, bubbles, button, cancelable, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, fromElement, handler, keyCode, layerX, layerY, metaKey, newValue, offsetX, offsetY, originalTarget, pageX, pageY, prevValue, relatedNode, relatedTarget, screenX, screenY, shiftKey, srcElement, target, toElement, view, wheelDelta, which
According to MDN, it varies by event type. The event.detail property...
Returns additional numerical information about the event, depending on the type of event. See the Notes section for details.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With