title: Autofocus With Cursor On End Of Textbox
body: <p>I want to put autofocus on a html textbox such that the cursor points to the end of some text already present in the textbox. 
  I know what the autofocus attribute does.  And I have also seen <a href="https://stackoverflow.com/questions/17780756/put-cursor-at-end-of-text-inputs-value">put cursor at end of text input&#39;s value</a> which answers how to put cursor at the end, But the textbox is not autofocussed upon page reload. How can I do both - autofocus the textbox upon page reload and put cursor to end of text ?</p>
  
  <pre><code>Code : 
  
   &lt;textarea id="txtArea" style="width:106%; height:100px" align="center" name="task1" onkeypress="onTestChange();" onfocus="this.value = this.value;" autofocus &gt;&lt;?php echo $_GET["task"];?&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p>I want to put Cursor after the text echoed. It is not the value of the textarea.</p>
  
  <p>Also the textbox I referred to is Textarea.</p>