title: How to replace all char except number [0-9] using javascript?
body: <p>How to replace all char except number [<code>0-9</code>] using Javascript?</p>
  
  <p>This is my code, </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>function test_fn(xxx) {
    var xxx = xxx.replace(/[^0-9,.]+/g, "");
    document.getElementById("fid").value = xxx;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input onkeyUp="test_fn(this.value)" id="fid"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But when user fill <code>012345...</code> my code can not replace dot [<code>.</code>] 
  How can I do for replace dot [<code>.</code>] too ?</p>