title: javascript regex for numpad
body: <p>I need to capture that pressed key is <strong>0-9</strong> including numbers from numpad. I wrote a function that checks it but  it doesn't work on numpad digits</p>
  
  <pre><code>function getKeyVal(e) {
     var order = String.fromCharCode(e.keyCode);
     return /^\s*\d+\s*$/.test(order)
  }
  </code></pre>
  
  <p><code>String.fromCharcode</code> return "<strong>a</strong>" from numpad key <strong>1</strong>. </p>
  
  <p>Can anybody help? </p>