title: Trying to calculate a simple discount and sales tax in javascript
body: <p>I'm just trying to input an number and then add 10% and then take that total and .08% tax. Can you please help me figure out what I'm doing wrong. I sure it is something simple I'm overlooking but I'm new to this and can't figure what is wrong.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Price tool&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
    &lt;form name="operation_form"&gt;
      &lt;label style="font-size:20px"&gt;&lt;b&gt;Price Tool&lt;/b&gt;&lt;/label&gt;
      &lt;br/&gt;
      &lt;br/&gt;
      &lt;br/&gt;
      &lt;label&gt;Item Price:  &lt;/label&gt;&lt;input type="number" name='acertscore' value="" /&gt;
      &lt;br/&gt;
      &lt;br/&gt;
      &lt;label&gt;&lt;b&gt;Total is:&lt;/b&gt;&lt;/label&gt;&lt;input type="number" name="answerbox"&gt;
      &lt;br/&gt;
      &lt;input type="button" value="Calculate" onclick="costCalc();" /&gt;
      &lt;br/&gt;
      &lt;input type="button" value="Reset" onClick="this.form.reset()" /&gt;
    &lt;/form&gt;
    
    &lt;script type="text/javascript"&gt;
      function costCalc() {
        var form = document.forms["operation_form"];
        var x = form["acertscore"].value;
        var cost = (x * .1) + x;
        var answer = (cost * .08) + cost;
        form["answerbox"].value = answer;
      }
    &lt;/script&gt;
    
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>