title: Set Focus After Last Character in Text Box
body: <p>I have 3 text boxes for a phone number.  As the user types, it automatically moves from one textbox to the next.  When the user presses backspace, I can move focus to the previous text box.  The problem is that in IE, focus is set to the beginning of the text box.  Here's my code, which works fine in chrome.</p>
  
  <pre><code>$('#AreaCode').live('keyup', function (event) {
      if ($(this).val().length == $(this).attr("maxlength"))
          $('#Prefix').focus();
  });
  
  $('#Prefix').live('keyup', function (event) {
      if (event.keyCode == 8 &amp;&amp; $(this).val().length == 0)
          $('#AreaCode').focus();
  
      if ($(this).val().length == $(this).attr("maxlength"))
          $('#Number').focus();
  });
  
  $('#Number').live('keyup', function (event) {
      if (event.keyCode == 8 &amp;&amp; $(this).val().length == 0)
          $('#Prefix').focus();
  });
  </code></pre>
  
  <p>How do I make the focus set at the end of the contents when going backwards?</p>