title: Unfocusing textbox with jQuery when key pressed
body: <p>I have a textbox that displays an alert when you click outside the textbox. I'm trying to also display the alert if the user presses Enter. Here's what I have:</p>
  
  <pre><code>&lt;input id="txtInput" type="text" onblur="alert('Hello');" /&gt;
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
      $("#txtInput").keyup(function (event) {
          if (event.keyCode == 13) {
              $(this).blur();
              return false;
          }
      });
  });
  </code></pre>
  
  <p>If I click inside the textbox and then click outside it, the alert shows correctly.</p>
  
  <p>But if I'm inside the textbox and push Enter, it shows the alert - when I dismiss the alert, another alert shows (I assume because onblur is being called on the textbox).</p>
  
  <p>Why doesn't calling <code>$(this).blur()</code> remove the focus from the textbox? Or is there a better way to do this?</p>