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.detailproperty…