标签:off htm com complete price key ice plain class
<
input
type="text" autocomplete="off" id="price" autofocus="autofocus" onkeyup="value=value.replace(/[^\d^\.]+/g,‘‘)">
onkeyup="value=value.replace(/[^\-?\d.]/g,‘‘)" 仅允许输入:正负小数。
<input type=
"text"
autocomplete=
"off"
id=
"price"
autofocus=
"autofocus"
onkeyup=
"value=value.replace(/[^\d^\.]+/g,‘‘).replace(‘.‘,‘$#$‘).replace(/\./g,‘‘).replace(‘$#$‘,‘.‘)"
> 仅允许输入一个小数点。
标签:off htm com complete price key ice plain class
原文地址:https://www.cnblogs.com/liweigang/p/14754603.html