Js限制Input框只能输入数字

<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" />

<input type="text" onkeyup="value=value.replace(/[^\d\.]/g,'')" />

猜你喜欢

转载自www.cnblogs.com/qingsong/p/10942986.html