title: Localstorage troubles
body: <p>I am trying to create a webapp, which you will click in a button, and his ID is saved to the localstorage, and change the style.
  But when I save in localstorage, the last button that i have click, replace the button´s ID before it.
  My code:</p>
  
  <pre><code>$(document).ready(function(){
      $("li a").click(function(){
          $("li a").removeClass('active');
          $(this).addClass('active');
          localStorage.setItem('ativo', $(this).html())
      });
  
      var ativo = localStorage.getItem('ativo');
  
      $("li a").each(function(index){
          if($(this).html() == ativo) {
              $(this).addClass('active');
          }
      });
  });
  </code></pre>
  
  <p>Please help me, thanks</p>