title: How to subtract a percentage from a number in Javascript?
body: <p>Here is the code that subtracts two var.</p>
  
  <pre><code>function calculate() {
  
          var myBox1 = document.getElementById('ax').value;   
          var myBox2 = document.getElementById('by').value;
          var myResult = myBox1 * myBox2;
          var myBox3= document.getElementById('myBox3');  
          myBox.value = myResult ;
  
          }
  </code></pre>
  
  <p>This is to take out percentage.</p>
  
  <pre><code>function calculate() {
              var myBox1 = document.getElementById('ax').value;   
              var myBox2 = document.getElementById('by').value;
              var myResult = myBox1 * myBox2;
              var myBox3= document.getElementById('myBox3');  
              var percentage = myResult/myBox3 -2%;
              myBox3.value = myResult ;
  }
  </code></pre>