title: How to set cursor position at the end of input text in Google Chrome
body: <p>I'm trying to set the cursor in a text field with a focus function. I've made some research but none of the provided solutions seemed to work in Google Chrome. In Internet Explorer and Firefox this solution is working fine: </p>
  
  <p>The js:</p>
  
  <pre><code>$('#Search').focus(function() {
    var SearchInput = $('#Search');
    var strLength= SearchInput.val().length;
    SearchInput.focus();
    SearchInput[0].setSelectionRange(strLength, strLength);
  });
  </code></pre>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;input type="text" id="Search" value="Hello World" /&gt;
  </code></pre>
  
  <p>Here's the link to my <a href="http://jsfiddle.net/esnvh/1/" rel="nofollow noreferrer">jsfiddle</a>.</p>
  
  <p>Is there any way to make this work in Google Chrome too?</p>