Jquery Limit Input to Numbers


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $('input.valid-number').bind('keypress', function(e) {
  2. return ( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)) ? false : true ;
  3. })

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.