title: Restrict characters in input field
body: <p>is there any option to use this code without showing the letters or characters when user type in input fields? this is the code i already tried and i want to keep it but now when i write restricted chars in input it show them for a second.I need to keep the input blank</p>
  
  <p><strong>EDIT:</strong> i dont want to change the code because this work great on tablets (other restrict character functions doesnt) . The only problem is that delay wehn you press restricted chars</p>
  
  <p>Code:  </p>
  
  <pre><code>function checkInput(ob){
      var invalidChars = /[^0-9]/gi
              if(invalidChars.test(ob.value)) {
                      ob.value = ob.value.replace(invalidChars,"");
            }
  };
  </code></pre>
  
  <p>HTML: </p>
  
  <pre><code>&lt;input class="input" maxlength="1" onChange="checkInput(this)" onKeyup="checkInput(this)" type="text" autocomplete="off"/&gt;
  </code></pre>