document.getElementById("按钮id").addEventListener("click", function() {
    var inputVal = document.getElementById("输入框id").value;
    var outputVal = inputVal.replace(/\\/g, "");
    document.getElementById("输入框id").value = outputVal;
  });