title: Prevent text field from blurring on button click
body: <p>Let's say I have a field and a button. The button submits the field and triggers some AJAX request which returns data to the same page. Every time the button is clicked, the field is deselected/blurred. This can be partially fixed by making the button focus the text field upon its click. However, during the click, there is a brief moment where the field blurs. The way I have my page set up this does not look good. I would like to completely prevent the field from blurring throughout the click. What is the easiest way to do this? Thanks!</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;input type="text" id="f" autofocus/&gt;&lt;span id="btn" onclick="document.getElementById('f').focus()"&gt;&lt;/span&gt;
  </code></pre>