title: Keep a button active even after page change
body: <p>I'm trying to keep the selected button active after the button is clicked, which changes the page. My current setup is</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;a class="btn btn-default nav" id="btn" type="button" href="index.php?mode=option"&gt;Option&lt;/a&gt;
  </code></pre>
  
  <p>JS: </p>
  
  <pre><code>$(function() {
  
      //Variable of previously selected
      var selected = [];
  
      //Setup Buttons
      $('.nav').button().click(function() { 
          //Enable previous
          if(selected[0]) {
              selected.button('enable').removeClass('active'); 
          }    
  
          //Cache the previous
          selected = $(this);
  
          //Disable this and keep color attributes
          selected.button('disable').addClass('active');
  
          //Do Normal Button Click Stuff Here
          $('#data').text(selected.text() + ' was clicked');
      });
      $('#btn').click();
  });
  </code></pre>
  
  <p>Currently all this does is the button <code>Option</code> is active, I click another, it changes to active but then it goes back to <code>Option</code> being active.</p>
  
  <p>I'd also like to be able to use this JS without having to have <code>nav</code> in the class of the button.</p>