title: Preserve toggle state using jQuery
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2523189/jquery-toggle-with-cookie">jQuery Toggle with Cookie</a>  </p>
  </blockquote>
  
  
  
  <p>Am having a simple toggle, but the toggle always resets when the page refreshes, so I want to preserve its state by setting a cookie but am not having much Idea how should I do it...</p>
  
  <p>Any idea how do I preserve the state of toggle?</p>
  
  <p><a href="http://jsfiddle.net/Qyufx/" rel="nofollow noreferrer">http://jsfiddle.net/Qyufx/</a></p>
  
  <pre><code>&lt;div class="question_trigger"&gt;
     &lt;p&gt;Hi&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class="toggle_container"&gt;
     &lt;div class="block"&gt;Hello&lt;/div&gt;
  &lt;/div&gt;
  
  
  jQuery(document).ready(function(){
          jQuery(".toggle_container").hide();
          jQuery("div.question_trigger").click(function(){
          jQuery(this).toggleClass("active").next().toggle("slow");
      });
  });​
  </code></pre>
  
  <p>​</p>