Possible Duplicate:
jQuery Toggle with Cookie
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...
Any idea how do I preserve the state of toggle?
<div class="question_trigger">
<p>Hi</p>
</div>
<div class="toggle_container">
<div class="block">Hello</div>
</div>
jQuery(document).ready(function(){
jQuery(".toggle_container").hide();
jQuery("div.question_trigger").click(function(){
jQuery(this).toggleClass("active").next().toggle("slow");
});
});