title: Button Toggle using :before :after with Font Awesome Icons
body: <p>I have a toggle button that uses the bars Font Awesome icon and I'm using the :after pseudo class to add a left caret to the left side of the bars. When I click the button, I want the left caret to go away and a right caret on the right side of the bars to appear. An example of this functionality is seen on the <a href="https://beta.onecodex.com/" rel="nofollow">One Codex Beta Site</a> (on that site it starts with a right caret on the right side of the bars, whereas I'm starting with a left caret on the left side of the bars).</p>
  
  <p>I've Googled for help on how to do this, but I haven't been able to get this to work as I want it to. Any ideas would be much appreciated. Thank you!</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div id="header" class="navbar navbar-default navbar-static-top"&gt;
          &lt;div class="container"&gt;
              &lt;div class="navbar-header"&gt;
                  &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav-collapse"&gt;
                      &lt;span class="sr-only"&gt;Toggle Navigation&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;/button&gt;
                  &lt;div id="logo" class="navbar-brand"&gt;
                      &lt;button type="button" id="toggleSidebar"&gt;
                          &lt;i class="navbar-icon fa fa-bars icon"&gt;&lt;/i&gt;
                      &lt;/button&gt;&lt;a href="index2.html" class="brand noline" title="Home"&gt;Brand&lt;/a&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="collapse navbar-collapse" id="nav-collapse"&gt;
                  &lt;ul class="nav navbar-nav navbar-right"&gt;
                      &lt;li id="nav-join"&gt;&lt;a href="#" id="join" title="Join"&gt;Sign Up&lt;/a&gt;&lt;/li&gt;
                      &lt;li id="nav-signin"&gt;&lt;a href="#" id="sign-in" title="Sign In"&gt;Sign In&lt;/a&gt;&lt;/li&gt;
                      &lt;li id="nav-about-us"&gt;&lt;a href="#" id="about-us" title="About Us"&gt;About Us&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$(document).ready(function(){
              $.asm = {};
              $.asm.panels = 2;
  
              $('#toggleSidebar').click(function(){
                  if ($.asm.panels === 1) {
                      $('#content').attr({'class': 'products col-lg-9'});
                      $('#sidebar').show();
                      $.asm.panels = 2;
                  } else {
                      $('#content').attr({'class': 'col-lg-12'});
                      $('#sidebar').hide();
                      $.asm.panels = 1;
                  }
              });
          });
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>.fa-bars:after {
    content: "\f0d9";
    float: left;
    padding-right: 5px;
  }
  
  #content {
      background-color: gray;
      padding: 0px;
      height: 100px;
  }
  </code></pre>
  
  <p>Here is my <a href="https://jsfiddle.net/msmasiello/jt7pao19/" rel="nofollow">JSFiddle</a></p>