You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returning false in jQuery event handlers stops the propagation of the event, while returning false in native event listeners only prevents the default.
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message.</p>
53
53
<p>The <code>blur</code> event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the <code>blur</code> event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping <code>blur</code> to the <code>focusout</code> event in its event delegation methods, <ahref="/live/"><code>.live()</code></a> and <ahref="/delegate/"><code>.delegate()</code></a>.</p>
54
+
<divclass="warning"><strong>Note:</strong> the consequences of returning <code>false</code> from an event handler in jQuery differ from returning <code>false</code> in a native event handler (<code>element.addEventListener("click", function () { return false; })</code>) in that jQuery calls <code>event.preventDefault()</code> and <code>event.stopPropagation()</code> and a native event handler only calls <code>event.preventDefault()</code>.</div>
54
55
</longdesc>
55
56
<example>
56
57
<desc>To trigger the blur event on all paragraphs:</desc>
0 commit comments