title: Adding an input field to the dom and focusing it in IE
body: <p>I am trying to make a div, that when you click it turns into an input box, and focuses it. I am using prototype to achieve this. This works in both Chrome and Firefox, but not in IE. IE refuses to focus the newly added input field, even if I set a 1 second timeout.</p>
  
  <p>Basically the code works like this:</p>
  
  <pre><code>var viewElement = new Element("div").update("text");
  var editElement = new Element("input", {"type":"text"});
  root.update(viewElement);
  
  // pseudo shortcut for the sake of information:
  viewElementOnClick = function(event) {
      root.update(editElement);
      editElement.focus();
  }
  </code></pre>
  
  <p>The above example is a shortened version of the actual code, the actual code works fine except the focus bit in IE.</p>
  
  <p>Are there limitations on the focus function in IE? Do I need to place the input in a form?</p>