title: How to make a backspace button work on HTML calculator?
body: <p><strong>Trial 1:</strong> Within the same HTML file</p>
  <p>Head:</p>
  <pre><code>&lt;script&gt;
      function backSpace() {
          var bsp = document.getElementById(&quot;ns&quot;).value;
          document.getElementById(&quot;ns&quot;).value=bsp.substring(0,bsp.length -1);
      }
  &lt;/script&gt;
  </code></pre>
  <p>Body:</p>
  <pre><code>&lt;span class=&quot;num&quot; onclick=&quot;backSpace()&quot;&gt;&lt;i class=&quot;fas fa-backspace&quot;&gt;Backspace&lt;/i&gt;&lt;/span&gt;
  </code></pre>
  <p><strong>Trial 2</strong><br />
  Is there a way to use &quot;--&quot; of the existing value and just backspace without using functions?</p>