title: Calculate percentage and display result in div element
body: <p>I'm trying to work out the percentage amount saved between price and saleprice and display the result in a div. So far I have the following but it doesn't seem to be working. Can anyone see where I'm going wrong?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function calc()
  {
      var price = 0;
      var saleprice = 0;
      var savingPercent = 0;
  
      price = Number(document.getElementById("price").value);
      saleprice = Number(document.getElementById("saleprice").value); 
  
      savingPercent =(((price - saleprice) / price) * 100).toFixed(0);
      document.getElementById('savingPercent').innerHTML = "You have saved" +savingPercent+"% ";  
  }
  &lt;/script&gt;
  
  &lt;div id="price"&gt;&amp;pound;100&lt;/div&gt;
  &lt;div id="saleprice"&gt;&amp;pound;20&lt;/div&gt;
  &lt;div id="savingPercent"&gt;&lt;/div&gt;
  </code></pre>