on focus not selecting current input value
<p>I am changing the focus of my item based off of its length. The problem that I am having is when it goes to the next input the value of the input is not selected. This causes a problem. If I want to edit a date and the current date is '12/10/2011' I should be able to select the month (highlight 12) and type '12112011' but what happens is when my focus goes from the month to the day category the cursor goes behind the the digits and either skips to the year category if I type quickly, or leaves the cursor after the digits if slowly. I built a delay into the function, and while that resolves the issue of skipping to the year category, it still leaves me with the cursor behind the values instead of selecting them. Which means I have to type '12+backspace+backspace+11+backspace+backspace++backspace+backspace+2011'</p>

<p>If the values were selected properly on change of focus all would theoretically be resolved for this issue. I know I may not have explained this well but fear not, jsfidlle is too the rescue. </p>

<p><a href="http://jsfiddle.net/rJwyE/1/" rel="nofollow">http://jsfiddle.net/rJwyE/1/</a></p>

<p>If you want to see the script I am using without accessing jsfiddle here it is. </p>

<pre><code>$('.dateSpinMonth').on('keyup', function () {
   if (this.value.length &gt;= 2) {
     $('.dateSpinDay').focus();
   }
});
$('.dateSpinDay').on('keyup', function () {
   if (this.value.length &gt;= 2) {
     $('.dateSpinYear').focus();
   }
});
</code></pre>

<p>html:</p>

<pre><code>&lt;div&gt;
   &lt;input class="dateSpinMonth" type="text" maxlength="2"/&gt; 
   &lt;span&gt;/&lt;/span&gt; 
   &lt;input class="dateSpinDay" type="text" maxlength="2"/&gt; 
   &lt;span&gt;/&lt;/span&gt; 
   &lt;input class="dateSpinYear" type="text" maxlength="4"/&gt;  
&lt;/div&gt;
</code></pre>
