title: Removing everything except numbers in a string
body: <p>I've made a small calculator in javascript where users enter the interest rate and amount the they want to borrow, and it calculates how much of an incentive they might get.</p>
  
  <p>The problem is that I'm worried users will enter symbols, e.g. </p>
  
  <blockquote>
    <p>Loan amount: £360,000  - Interest Rate: 4.6%</p>
  </blockquote>
  
  <p>I'm not worried about the decimal places as these are needed and don't seem to affect the calculation, it's the symbols like £ and % which mess things up.</p>
  
  <p>Is there a simple way to strip out these symbols from the code:</p>
  
  <pre><code>&lt;td&gt;&lt;input type="text" name="loan_amt" style="background-color:#FFF380;"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="interest_rate" style="background-color:#FFF380;"&gt;&lt;/td&gt;
  
  
  function Calculate()
  {
      var loan_amt = document.getElementById('loan_amt').value;
      //this is how i get the loan amount entered
      var interest_rate = document.getElementById('interest_rate').value; 
      //this is how i get the interest rate
  
      alert (interest_rate);
  }
  </code></pre>