title: How to unselect the text of a textbox when it gets focus, when tab is pressed?
body: <p>I have a series of text boxes in a row, which are used to enter time. When the user comes back to an already edited text box, the browser highlights the text within that textbox. </p>
  
  <ol>
  <li>How would I un-select the text in it when the text box gets the focus, and</li>
  <li>Set the cursor to the beginning of the text within the text box?</li>
  </ol>
  
  <p>I have tried the following ways but for no good:</p>
  
  <p>In textboxfocushandler:</p>
  
  <pre><code>var html = $("#MyTextArea").val();
  $("#MyTextArea").focus().val("").val(html);
  </code></pre>
  
  <p>Select handler for textbox:</p>
  
  <pre><code>if (window.getSelection) {
      if (window.getSelection().empty) {  // Chrome
          window.getSelection().empty();
      } else if (window.getSelection().removeAllRanges) {  // Firefox
          window.getSelection().removeAllRanges();
      }
  } else if (document.selection &amp;&amp; document.selection.empty) {  // IE?
      document.selection.empty();
  }
  </code></pre>