我有两个文本框,textbox1 回显数据库 $row 中的值,并在数字分组上显示 1,900,200.00。我的 textbox2 使用 javascript 自动复制 textbox1 的精确值。我想要做的是替换 textbox2 中的逗号 (,)。
最佳答案
document.getElementById('txt2').value = document.getElementById('txt1').value.replace(/,/g, '');
关于javascript - 如何替换文本框中的逗号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18863124/