<input type='text' onkeyup="this.value=this.value.replace(/[^0-9]+/,'');" />/只能输入非负整数 <input type='text' onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" />只能输入整数