title: Get the input selector using this
body: <p>I have set of input fields which are generated dynamically, hence I can't use an ID. For each of the input fields I have a focusout method which validates the value input by the end user.</p>
  
  <p>If the validation fails, I would like to clear the value of the input and bring back the focus to the same input. When I tried to use this keyword scope seems to be set to the windows rather than the input control. </p>
  
  <p>Input fields screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/y9s6v.png" alt="Input fields screenshot"></p>
  
  <pre><code>function validate(reg){
  debugger;
  if(isNaN(reg)==false){
      return;
  }
  else
  {
      alert("The field should contain number");
      $(this).val(""); //clear the value
      $(this).focus();
  }
  }
  </code></pre>
  
  <p>In the above code, this keyword doesn't seem to work. </p>