title: Changing fontawesome icon on click not working
body: <p>I have a 'volume' icon that will mute sounds when clicked, and unmute when clicked again. I used .addClass() and .removeClass() to toggle between icon classes. While I am able to change from "fa-volume-up" to "fa-volume-off", I cannot do the reverse; for some reason it's not passing the "else if" condition after the icon has changed to 'volume-off'.</p>
  
  <p>I want to change the icon from 'fa-volume-up' to 'fa-volume-off'.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// index.js
  $(function() {
    $('#vol-btn').on('click', function() {
      if ($(this).hasClass('fa-volume-up')) {
        $(this).removeClass('fa-volume-up').addClass('fa-volume-off');
        //sound.mute(true);
        console.log("Muting sound.")
  
        // it won't enter this condition!
      } else if ($(this).hasClass('fa-volume-off')) {
        $(this).removeClass('fa-volume-off').addClass('fa-volume-up');
        //sound.mute(false);
        console.log("Unmuting sound.")
      }
    });
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!--index.html --&gt;
  &lt;div class='btns'&gt;
    &lt;i id='vol-btn' class="fa fa-volume-up"&gt;&lt;/i&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>