Using jQuery force user to input only numeric data; i.e. only numbers without any decimal point, comma, special characters or alphabets.

HTML Code

<input class="allowNumberOnly" type="text" />

JavaScript/jQuery:

/*global $ */
$(".allowNumberOnly").on("keypress", function (e) {

     use strict";

     return (e.which !== 8 && e.which !== 0 && (e.which < 48 || e.which > 57)) ? false : true;
});