时间:2021-07-01 10:21:17 帮助过:229人阅读
废话不多说,直接贴出代码如下:
<input type="text" name="tags" onKeyUp="ReplaceDot(this)"> <script type="text/javascript"> function ReplaceDot(obj) { var oldValue=obj.value; while(oldValue.indexOf(",")!=-1)//寻找每一个中文逗号,并替换 { obj.value=oldValue.replace(",",","); oldValue=obj.value; } obj.value = oldValue; } </script>