title: Tab event changes the focus even after focus is set in javascript
body: <p>I have two input elements, one a text box and the next one a drop down list(ddl) side by side in a HTML page. The user is supposed to enter a value greater than 5 (its just an example) and then select an item from the ddl. </p>
  
  <p>I have written a validation that happens whenever there is a change in the text box. If the value is not greater than 5, then the user is informed the value should be greater than 5 and the focus is set to the text box. (I am using Jquery)</p>
  
  <pre><code>$(".textBox").change( function(){
    alert("Quantity should be greater than 5");
    $(this).val("");
    $(this).focus();  
  }
  </code></pre>
  
  <p>Now here is the problem, </p>
  
  <p>Case 1:
  When the user enters a value below 5 and presses tab logically the focus should come back to the textbox after the alert, but the focus seems to have moved to the dropdown list.</p>
  
  <p>Case 2:
  When the user enters a value below 5 and clicks on the dropdown list, there is an alert message, but instead of the focus being in the text box, the drop down list has expanded.</p>
  
  <p>I would like to know why this is happening and how to fix it so that if the value is less than 5 then the focus should be on the text box.</p>
  
  <p>Any help is appreciated.
  nJ</p>