title: Replacing a dot using JavaScript instead removes everything
body: <p>I've walked into a strange problem. When trying to replace a dot on a number input, instead of replacing just that dot, it clears out the entire input.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("[data-input-payment-id]").on("keyup", function(e) {
    var test_value = $(this).val().replace(/\./g, "");
    $(this).val(test_value);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="number" data-input-payment-id="12"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="http://jsfiddle.net/xpvt214o/511118/" rel="noreferrer">JSFIDDLE</a></p>
  
  <p>How do I change it so it only removes the dots?</p>