title: Why my calculator is only allowing me to perform one type of operation
body: <p>I am creating a simple calculator but for some reason or another only the subtraction operation is working. Anytime I try to perform another operation it just does subtraction. No, there are no error messages displayed within the console whenever I perform the other operations (i.e mul, add and div).</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;div class="container"&gt;
  
          &lt;!--First operand--&gt;
          &lt;input type="text" class="operand" id="operand1" placeholder="First Input"&gt;
  
          &lt;!--Operation section--&gt;
          &lt;select id="operator"&gt;
              &lt;option value="add" id="add"&gt;+&lt;/option&gt;
              &lt;option value="sub" id="sub"&gt;-&lt;/option&gt;
              &lt;option value="add" id="mul"&gt;*&lt;/option&gt;
              &lt;option value="add" id="div"&gt;/&lt;/option&gt;
          &lt;/select&gt;
  
          &lt;!--Second operand--&gt;
          &lt;input type="text" class="operand" id="operand2" placeholder="Second Input"&gt;
  
          &lt;button type="submit" id="button"&gt;Submit&lt;/button&gt;
  
          &lt;div class="results" id="results"&gt;20&lt;/div&gt;
  
      &lt;/div&gt;
  
  
      &lt;script src="calc.js"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  
  
  <pre><code>//Retrieved html elements
  var opOne = document.getElementById("operand1");
  var opTwo = document.getElementById("operand2");
  
  //operators
  var add = document.getElementById("add");
  var sub = document.getElementById("sub");
  var mul = document.getElementById("mul");
  var div = document.getElementById("div");
  
  //Result field
  var result = document.getElementById("results");
  
  //Button
  var button = document.getElementById("button");
  
  
  //When button is clicked
  button.addEventListener("click", () =&gt; {
  
      if(sub) {
              result.textContent = Number(opOne.value) - Number(opTwo.value);
                  console.log("Subtraction works");
      }  else if(add) {
              result.textContent = Number(opOne.value) + Number(opTwo.value);
                  console.log("Additon works");
      }  else if(mul) {
              result.textContent = Number(opOne.value) * Number(opTwo.value);
                  console.log("Multiplication works")
      }   else if(div) {
              result.textContent = Number(opOne.value) / Number(opTwo.value);
                  console.log("Divison works")
      }
  });
  </code></pre>