Normalize Input/Textarea – Number Only

No jQuery.

HTML5:

<input type="number" min="0" step="1"/>

JavaScript:

//forbid all (most..) of "not digits" but allow some text-related operation (delete, backspace,...)
text.onkeydown = function (ev) {
  ev.stopPropagation();

  if (255 === ev.keyCode) return false; //Lenovo-FN key changes BACKSPACE.
  if (16 === ev.keyCode || true === ev.shiftKey) return false; //SHIFT changes 1 to ! .
  if (true === ev.ctrlKey) return true; //allow all CTRL+[???] combination, for example CTRL+A to select all text.

  return -1 !== [
      48, 49, 50, 51, 52, 53, 54, 55, 56, 57
      , 13/*ENTER*/, 17/*CTRL*/, 18/*ALT*/, 35/*END*/, 36/*HOME*/, 37/*LEFT*/, 38/*UP*/, 39/*RIGHT*/, 40/*DOWN*/, 8/*BACKSPACE*/, 116/*F5*/
    ].indexOf(ev.keyCode)
};

It will support arrow up for value increase (and arrow down for — ..)
but will also show bugging weird arrows on the right border.

add this CSS3:

/* normalize HTML input type="number". */
input::-webkit-inner-spin-button,        input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button:hover,  input::-webkit-outer-spin-button:hover,
input::-webkit-inner-spin-button:active, input::-webkit-outer-spin-button:active,
input::-webkit-inner-spin-button:focus,  input::-webkit-outer-spin-button:focus { display: none }

Disabling the up/down arrows can be done by removing the keyCodes 38/39 from the onkeydown event..
:)