html input 文本框 只能输入数字,包含输小数点.

<input type="text" id="source_tds" name="source_tds" value="<{$source_tds}>" 
onkeyup
="if(isNaN(value)){execCommand('undo');alert('只能输入数字 !');}"
onafterpaste
="if(isNaN(value))execCommand('undo')"

></input>

猜你喜欢

转载自www.cnblogs.com/hailexuexi/p/9185210.html
今日推荐