Focus and select all input box after append of input box
<p>I need to implement a generation input box, and upon generation there is a default value, that default value should auto focus and all text should be selected;</p>

<p>Here is my function in JS assuming a button has been click and call this function </p>

<pre><code>function createFolder()
{
   var newTextBoxDiv = $(document.createElement('div')).attr({   
                        "id" : 'TextBoxDiv',
                        "class" : 'TextBoxDiv+ctr'
                        });   
   newTextBoxDiv.html('&lt;input type="text" name="folder_name" id="folder_name"   value="New Folder"/&gt;');

   $("#folder_name").focus(function() { $(this).select(); } );

   newTextBoxDiv.appendTo("#fileTreeView");

}
</code></pre>
