title: How to remove all non-numeric characters from a variable
body: <p>How can I remove all text characters (not numbers or float) from a javascript variable ?</p>
  
  <pre><code>function deduct(){
      var getamt= document.getElementById('cf').value; //eg: "Amount is 1000"
      var value1 = 100;
      var getamt2 = (value1-getamt);
      document.getElementById('rf').value=getamt2;
  }
  </code></pre>
  
  <p>I want <code>getamt</code> as number. <code>parseInt</code> is giving <code>NaN</code> result.</p>