Suggestion for input type="text" instead HTML5 input input type="number":
//HTML
<input id="inp" type="text" />
//JAVASCRIPT (JQUERY NEEDED)
function onlyNumbers(evt) {
    // SOME OPTIONS LIKE ENTER, BACKSPACE, HOME, END, ARROWS, ETC.
    var arrayExceptions = [8, 13, 16, 17, 18, 20, 27, 35, 36, 37,
        38, 39, 40, 45, 46, 144];
    if ((evt.keyCode < 48 || evt.keyCode > 57) &&
            (evt.keyCode < 96 || evt.keyCode > 106) && // NUMPAD
            $.inArray(evt.keyCode, arrayExceptions) === -1) {
        return false;
    }
}
$('#inp').on('keydown', onlyNumbers);
//JAVASCRIPT (WITHOUT JQUERY)
function inArray(value, arr) {
    for(var i = 0; i < arr.length; i++) {
        if (value === arr[i]) {
            return i;
        }
    }
    return -1;
}
function onlyNumbers(evt) {
    // SOME OPTIONS LIKE ENTER, BACKSPACE, HOME, END, ARROWS, ETC.
    var arrayExceptions = [8, 13, 16, 17, 18, 20, 27, 35, 36, 37,
        38, 39, 40, 45, 46, 144];
    if ((evt.keyCode < 48 || evt.keyCode > 57) &&
            (evt.keyCode < 96 || evt.keyCode > 106) && // NUMPAD
              inArray(evt.keyCode, arrayExceptions) === -1) {
        return false;
    }
}
document.getElementById('inp').onkeydown = onlyNumbers;
As I said in my comment, until HTML5 becomes an standard web language that we can work with it properly, I prefer to use this.
Demo with jQuery 
Demo without jQuery
     
    
this.valuegive (in place of$(this).val())?<input type="text"...and set an.onkeyupfunction to accept only numbers (regex for example), because HTML5 it's not really supported by all.