only int number
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
參考網址: http://www.stevendobbelaere.be/allow-only-numeric-input-or-disallow-spaces-with-javascript/