title: Javascript Gross & Net Pay Calculator
body: <p>So I am making an elementary gross pay and net pay calculator in javascript/HTML. The webpage calculator takes the user inputted hours and rate, and spits out gross pay, and gross pay with tax. For some reason, it won't display the correct formula. Somewhere I made a grave error. If someone can steer me in the right direction that would be awesome. </p>
  
  <p>Heres the code: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;title&gt;Gross + Net Pay&lt;/title&gt;
  &lt;h1&gt;Gross + Net Pay Calculator&lt;/h1&gt;
  &lt;p id="demo"&gt;&lt;/p&gt;
  &lt;p id="demo2"&gt;&lt;/p&gt;
  &lt;script&gt;
  function myFunction() {
  var rate = document.getElementById("payrate");
  var hours =document.getElementById("hours");
  var gross = hours * rate
  var net = gross * .9 
  
   if (gross != null) {
      document.getElementById("demo").innerHTML = gross;
  }
   if (net != null) {
      document.getElementById("demo2").innerHTML =net;
          }
  
    }
  &lt;/script&gt;
  &lt;body&gt;
  &lt;form&gt;
  Pay Rate: &lt;input type="text" id="payrate"&gt;&lt;br&gt;
  Hours Worked: &lt;input type="text" id="hours"&gt;&lt;br&gt;
  &lt;input type="submit" value="Calculate Gross + Net Pay" onclick="myFunction()"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>