input框只能输入0或者正整数

<input type="text" onkeyup="value=(value.replace(/D/g,'')==''?'':parseInt(value))" maxlength="10">

原文地址:https://www.cnblogs.com/javatk/p/7400777.html