title: Prevent HTML5 autofocus from displaying soft-keyboard on smaller (mobile) screens
body: <p>Using the HTML5 attribute "autofocus" can be a really useful thing for web pages. However, using - for example - Firefox (37.0.1) on Android devices results in the soft keyboard being displayed on page load.</p>
  
  <pre><code>&lt;input type="text" name="q" autofocus&gt;
  </code></pre>
  
  <p>The soft-keyboard takes up a lot of space and therefore I'd like to prevent this from opening. At the same time, autofocus is a very useful feature that we need for normal screens/devices.</p>
  
  <p>I tried removing the "autofocus" attribute based on screen width via jQuery on page load, however, that's too late. At this point, the browser apparently already accepted the attribute and shows the soft keyboard:</p>
  
  <pre><code>$(function(){
      if (window.innerWidth &lt; 600)
          $('*[autofocus]').removeAttr('autofocus');
  });
  </code></pre>
  
  <p>Any suggestions?</p>