title: How to prevent non-alphanumeric input in javascript?
body: <pre><code>$("#user").keyup(function(e){ 
      var regx = /^[A-Za-z0-9]+$/;
      if (!regx.test('#user')) 
      {$("#infoUser").html("Alphanumeric only allowed !");}
  );}
  </code></pre>
  
  <p><code>#user</code> is a text input, and  I want to diplay a warning if user enters anything except letters and numbers.<br>
  In the above case, the warning is present whatever is typed.</p>