经过input上的onkeyup事件运用正则判断value值“/1/g”onkeyup="value=value.replace(/2/g,'')"(能够填小数点)onkeyup="this.value=this.value.replace(/D/g,'')" (不能够填小数点)this