title: How to use .toFixed() from an input field
body: <p>I can't seem to understand why I can't get <code>.toFixed()</code> to work in my code. I've tried different variations but something is missing. </p>
  
  <p>I get the following error upon running the code.</p>
  
  <blockquote>
    <p>Uncaught TypeError: document.getElementById(...).value.toFixed is not
    a function</p>
  </blockquote>
  
  <p>My Code:</p>
  
  <pre><code>&lt;input type="number" id="num1"&gt;
  &lt;p&gt;+&lt;/p&gt;
  &lt;input type="number" id="num2"&gt;
  &lt;p&gt;=&lt;/p&gt;
  &lt;p id="result"&gt;&lt;/p&gt;
  &lt;br&gt;
  &lt;button id="submit" onclick="calculate()"&gt;Calculate&lt;/button&gt;
  
  &lt;script&gt;
    function calculate(){
      const a = document.getElementById("num1").value;
      const b = document.getElementById("num2").value;
  
      let finalAnswer = a.toFixed(2) + b.toFixed(2);
      document.getElementById("result").innerHTML = finalAnswer;
      console.log(a);
      }
  &lt;/script&gt;
  </code></pre>