title: jQuery: if and else if statements with &&?
body: <p>I'm trying to create an <code>if</code> and <code>else if</code> statements using jQuery and I will have two conditions in the if and the else if statements, So I am using <code>&amp;&amp;</code> as well.</p>
  
  <p>However, every time I use the <code>if</code> and <code>else if</code> in my code, my code stops working and I cannot figure out why this is keep happening.</p>
  
  <p>To explain this better, I've created this <a href="https://jsfiddle.net/m5oobxrq/" rel="nofollow">FIDDLE</a></p>
  
  <p>The code in question is this:</p>
  
  <pre><code>    if ($button.text() == "+" &amp;&amp; parseFloat(oldValue) == parseFloat(maximum)) {
      alert("You cannot do that");
      }else if($button.text() == "+" &amp;&amp; parseFloat(oldValue) &gt; parseFloat(maximum)){
  .........................
  </code></pre>
  
  <p>if i change the code above to:</p>
  
  <pre><code>    if ($button.text() == "+") {
  .........................
  </code></pre>
  
  <p>everything works fine as it should but with the if and else if statements, nothing seems to work and I don't see any errors in the consul either.</p>
  
  <p>Could someone please advise on this issue?</p>
  
  <p>is there something that I'm missing?</p>
  
  <p>any help would be appreciated.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Based on some of the answers, I've edited my code but I still have a slight issue!</p>
  
  <p>The issue is the number of the input and remaining changes even if the <code>oldValue &gt;= maximum</code>. This is the <a href="https://jsfiddle.net/m5oobxrq/9/" rel="nofollow">FIDDLE</a></p>