MENU
The Event Object
event.currentTarget The current DOM element within the event bubbling phase. event.delegateTarget The element where the currently-called jQuery handler was attached. event.relatedTarget The other DOM element involved in the event, if any. It indicates the element being entered for 'mouseout', and the element being exited for 'mouseover'. event.target The DOM element that initiated the event within the event bubbling phase. |
event.data An optional data object passed to an event method when the current handler is bound. event.metaKey Return true if the Meta key was pressed. event.namespace The namespace specified when the event was triggered. event.pageXevent.pageY The mouse position. event.result The last value returned by an event handler that was triggered by this event. event.timeStamp The difference in milliseconds between the event time and January 1, 1970. event.typeA string describing the nature of the event. event.whichWhich keyboard key (charCode) or mouse button (1: left, 2: middle, 3: right) was pressed. |
event.preventDefault()event.stopImmediatePropagation()event.stopPropagation() Prevent the default action (9.6.13) or stop the event propagation (9.6.14) if the event triggers the handlers of other elements. event.isDefaultPrevented()event.isImmediatePropagationStopped()event.isPropagationStopped() Return true if the default action is prevented or if the event propagation is stopped. |
RESETRUNFULL
<!DOCTYPE html><html><head><script src="jquery-3.5.1.min.js"></script><script> $().ready(function(){
$('button').click(function(){return 20;});
$('button').click({a:10},function(e){
alert (e.data.a + e.result); // 30
});});</script> </head><body>
<button>Click</button></body></html>