title: Using different Variable in an equation base of gender
body: <p>I'm trying to calculate the Wilks Score of a lifter and the formula i'm using calls for different variable used in the equations between male and female lifters. How come it keeps returning the male formula instead of the female version. </p>
  
  <pre><code>&lt;div id="wilks"&gt;
          &lt;select id="gender"&gt;
              &lt;option value="male"&gt;Male&lt;/option&gt;
              &lt;option value="female"&gt;Female&lt;/option&gt;
  
          &lt;/select&gt;
          &lt;br&gt;
          &lt;input id="big3Total" type="text" placeholder="Big 3 Total"&gt;
          &lt;input id="bodyWeight" type="text" name="" placeholder="Bodyweight in Lbs"&gt;
          &lt;button onclick="wilks()"&gt;Calculate&lt;/button&gt;
          &lt;p id="wilksScore"&gt;&lt;/p&gt;
  
  &lt;/div&gt;
  
  &lt;script&gt;  
  function wilks() {
   var gender = document.getElementById("gender");
              if ( gender == 'male') {
                  a = -216.0475144;
                  b = 16.2606339;
                  c = -0.002388645;
                  d = -0.00113732;
                  e = 7.01863E-06;
                  f = -1.291E-08;
              } else {
                  a = 594.31747775582;
                  b = -27.23842536447;
                  c = 0.82112226871;
                  d = -0.00930733913;
                  e = 4.731582E-05;
                  f = -9.054E-08;
              }
  
              var big3Total = document.getElementById('big3Total').value * 0.453592;
              var bodyWeight = document.getElementById('bodyWeight').value * 0.453592;
              var wilks = big3Total * (500 / (a + (b * bodyWeight) + (c * Math.pow(bodyWeight, 2)) + (d * Math.pow(bodyWeight, 3)) + (e * Math.pow(bodyWeight, 4)) + (f * Math.pow(bodyWeight, 5))));
              document.getElementById('wilksScore').innerHTML = "Your Wilks score is: " + wilks.toFixed(2);
  
          }
  &lt;/script&gt;
  </code></pre>