title: Setting 'autofocus' attribute with JavaScript not working
body: <p>I am writing a small plugin, and the plugin will encapsulate an autofocus setting, but when I add the attribute dynamically with JavaScript, it doesn't autofocus the page, which is weird. Is there anyway around this?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="text"&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>document.querySelector('input').setAttribute('autofocus', 'autofocus');
  </code></pre>
  
  <p>Without doing:</p>
  
  <pre><code>document.querySelector('input').setAttribute('autofocus', 'autofocus').focus();
  </code></pre>
  
  <p>jSFiddle: <a href="http://jsfiddle.net/wPUNN/" rel="noreferrer">http://jsfiddle.net/wPUNN/</a></p>