To make input numeric only in jQuery you can use the following snippet.

Sample jQuery

$('input.numbersOnlyinput').bind('keypress', function(input) {   
    return (input.which === 0 || input.which === 8 || (input.shiftKey === false && (input.which < 58 && input.which > 47))) ? true : false;   
}

2 thought on “How to make input numeric only in jQuery”

Leave a Reply