title: In Javascript DOM, is it ok to set focus to an item and later render the item in the document?
body: <p>For example:</p>
  
  <pre><code>// build the form
  var form = document.createElement('form');
  var item = document.createElement('item');
  form.appendChild(item);
  
  // item is where we want our future focus
  item.focus();
  ....
  
  // render the form
  document.getElementById('id').appendChild( form );
  </code></pre>
  
  <p>Is this legal? Will focus be on <code>item</code> once rendered?</p>
  
  <p>This is important because I am dealing with a library that expects me to pass a built form that it will then place on the page. I would like to ensure proper focus when the form has been rendered.</p>