title: Simple Javascript tax calculator
body: <p>I am working on a tax calculator, and i don't get it to work. The only result i get is NaN, and I can't find what's wrong with my code. If the users input is 450 000 or more, the output is supposed to be 32% of their salary else 28%.</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
     &lt;head&gt;
       &lt;meta charset="utf-8"&gt;  
       &lt;meta name="description" content="Skatt"&gt;
       &lt;meta name="author" content="Gandalf"&gt;  
       &lt;title&gt;Taxes&lt;/title&gt;
     &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="text" id="salary" value="0" /&gt;
      &lt;button id="button"&gt;Calculate tax!&lt;/button&gt;
      &lt;h2 id="salaryOut"&gt;Your salary is NOK:&lt;/h2&gt;
      &lt;h2 id="taxOut"&gt;You should pay taxes with the amount of:&lt;/h2&gt;
  
  &lt;script&gt;
      var button = document.getElementById("button");
  
      button.onclick = function() {
  
      var salary = document.getElementById("salary");
      salary.value = 0;
  
      var salaryOut = document.getElementById("salaryOut");
      salaryOut.value = salary;
  
      var salaryOut = document.getElementById("taxOut");
      taxOut.value = parseFloat(salaryOut.value);
  
      if(salaryOut.value&lt;450000) {
          taxOut.value = salaryOut.value * .28;
      } 
      else {
          taxOut.value = salaryOut.value * .32;
      }
          salaryOut.innerHTML = ("Your salary is NOK: " + salary.value + ",-");   
          skattUt.innerHTML = "You should pay NOK: " + taxOut.value + ",-";
      }           
  &lt;/script&gt;   
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>