title: Select a text after alert
body: <p>I'm testing a syntax for an email input. And it is alerting some message on the web browser if the email syntax is wrong. After the user clicks ok on that messsage I want the browser to select the text.</p>
  
  <pre><code>var input = document.createElement('input');
  document.body.appendChild(input);
  input.onblur = function(){
      var reg = /^([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
      if(reg.test(this.value) == false){
          alert('Wrong syntax on e-mail');
          $(this).select();//This doesn't work!
      }
  }
  </code></pre>