title: document.getElementById
body: <p>I'm working on an assignment in my beginner Javascript class that involves an element document.getElementById on the first line below the var total. There is an error of missing ";" but the semicolon is there. So I know that it must be something else. Here is the code. Any suggestions?</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;title&gt;Price Calculator&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  function fixOrder(){
  const TAX = 0.975;
  var numPrice = parseFloat(document.getElementById("cost").value);
  
  
  var subtotal = numPrice * TAX;
  var total = subtotal + tax;
  document.getElementById("cost").value = "$" cost.ToFixed(2);
  document.getElementById("tax").value ="$" tax.ToFixed(2);
  document.getElementById("total").value ="$" total.ToFixed(2);
  }
  
  function placeOrder(){
  if (document.getElementById("cost") == ""
  isNaN(document.getElementById("cost")
  alert("Sorry,you must enter a numeric value to place order")
  if (document.getElementById("tax") == ""
  isNaN(document.getElementById("tax")
  alert("Sorry, you must enter a numeric value to place the order");
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body bgcolor="#00f3F1"&gt;
  &lt;frame align="left"&gt;
  &lt;legend&gt;
  &lt;h1 align="center"&gt;Price Calculator&lt;/h1&gt;
  &lt;/legend&gt;
  &lt;form name="purchases" action="donut.php"  method="POST"&gt;
  
  Price:&lt;p&gt; &lt;input type="text" id="cost" name="cost" value="" onchange="fixOrder"&gt;
  &lt;/p&gt;
  Tax:&lt;p&gt;  &lt;input type="text" id="tax" name="tax" value="" onchange="fixOrder"&gt;
  &lt;/p&gt;
  Total:&lt;p&gt; &lt;input type="text" id="total" name="total" value="" &gt;
  &lt;/p&gt;
  &lt;/form&gt;
  &lt;/frame&gt;
  
  
  
  &lt;div id="cost" name="cost" value="" onchange="placeOrder();"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>