title: Javascript Regex Only Textbox
body: <p>I was able to find the solution for this in c# / .net but not for regular web html. If there's already an answer let me know and i'll close question.</p>
  
  <p>How to create a text box that only will allow certain characters (ex. alphanumeric) based on a given regex (ex. [a-zA-Z0-9])? So if a user tries to enter anything else, paste included, it is removed or not allowed.</p>
  
  <pre><code>&lt;input type="text" class="alphanumericOnly"&gt;
  </code></pre>