title: How to keep focus after validation when use tab key
body: <p>I have input text fields in jsp, and I use onChange="validation(this);" to check if null input and so on, but when I use tab key, cursor will be move to next field, how can keep cursor on validation field?</p>
  
  <pre><code>function validation(id) {
      var obj = document.getElementById(id);
      obj.value = obj.value.toUpperCase();
  
      if(value == "") {
          obj.focus();
          obj.select();
      }
   }
  </code></pre>