/*
input输入框只允许输入数字
*/
<input type="text" οnkeypress="keyPress()" >
function keyPress() {
var keycode = event.keyCode;
if ((keycode >= 48) && (keycode <= 57)) {
event.returnValue = true;
} else {
event.returnValue = false;
}
};