I am creating a web page where I have an input text field in which I want to allow only numeric characters like (0,1,2,3,4,5...9) 0-9.
How can I do this using jQuery
I think it will help everyone
$('input.valid-number').bind('keypress', function(e) { return ( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)) ? false : true ; })