Wednesday, August 8, 2012

Allow only numbers in textbox jquery on key press

HTML



Jquery


$("#num").keypress(function (e){ var charCode = (e.which) ? e.which : e.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } }); ​

No comments:

Post a Comment