title: set the cursor at the end of the string?
body: <p>When I replace a string with another, the cursor is moved to the beginning of the string in the text. Can the cursor be moved at the end instead of the start of the string?</p>
  
  <p><strong>index.jsp</strong>:</p>
  
  <pre><code>var val1=request.responseText;
  var text=document.getElementById("para").innerHTML;
  if(val1!="true")
  {
      var afterplace=text.replace("good",val1);
      document.getElementById("para").innerHTML=afterplace;
  }
  </code></pre>
  
  <p>After replacement the cursor come at the start of the word I want it at the end. </p>