<input id="amount" style="IME-MODE: disabled; WIDTH: 60px; HEIGHT: 15px"
onkeyup="this.value=this.value.replace(/\D/g,‘‘)"
onafterpaste="this.value=this.value.replace(/\D/g,‘‘)"
maxlength="5" size="14" name="amount" type="text" />
<input onpaste="return false" id="amount"
style="IME-MODE: disabled; WIDTH: 60px; HEIGHT: 15px"
onpropertychange="if(isNaN(value)) value=value.substring(0,value.length-1);"
maxlength="5" size="14" name="amount" />
原文地址:http://www.cnblogs.com/shijiaoyun/p/3854848.html