Home › Forums › JavaScript › Restricted the input field › Re: Restricted the input field
February 5, 2013 at 4:09 am
#105685
Bert
Participant
Formatting on CSS-tricks is a bit tricky sorry:
HTML:
jQuery:
$(‘.numbers’).keypress(function(key) {
if(key.charCode < 48 || key.charCode > 57) return false;
});