title: keydown Event to override return key does not work in Firefox
body: <p>I have the following simple javascript code, which handles the Return Key, I don't want to submit the form when the return key is pressed in the textbox.</p>
  
  <p>All this works fine, but in Firefox, if i show an alert message, then it stops working and the form starts getting submitted, whereas the exact code without alert message works fine and stops the form from being submitted. I dont understand why alert is spoiling the party..</p>
  
  <pre><code>    $("document").ready(function () {
          $("#input1").keydown(OnKeyDown);
      });
  
  
      function OnKeyDown(e) {
          if (e.keyCode == 13) {
  
              // alert('this will fail');  // Adding alert makes the form submit
  
              stopBubble(e);
              return false;
          }
      }
  
      function stopBubble (e) {
  
          // If an event object is provided, then this is a non-IE browser
          if (e &amp;&amp; e.stopPropagation)
          // and therefore it supports the W3C stopPropagation() method
              e.stopPropagation();
          else
          // Otherwise, we need to use the Internet Explorer
          // way of cancelling event bubbling
              window.event.cancelBubble = true;
      }
  
  
    &lt;input type="text" id="input1" value=""&gt;
  </code></pre>