Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8835579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:17:29+00:00 2026-06-14T09:17:29+00:00

Hello been looking around online for this for awhile and would really appreciate some

  • 0

Hello been looking around online for this for awhile and would really appreciate some help please. I need to know what script that invloves cookies can keep a toggled div in the below code in a “CLICKED” state after the page reloads. Appreciate all and anyones help and give much thanks in advanced.

<!DOCTYPE html>
<html>
<head>
  <style>
      p.one { position:relative; width:400px; height:90px; }
      div.two { position:relative; width:400px; height:65px; 
        font-size:36px; text-align:center; 
        color:yellow; background:red;
        padding-top:25px; 
        top:0; left:0; display:none; }
        span.three { display:none; }
      </style>
  <script src="http://code.jquery.com/jquery-latest.js"></script>


</head>
<body>
  <p class="one">
        Let it be known that the party of the first part
        and the party of the second part are henceforth
        and hereto directed to assess the allegations
        for factual correctness... 



 <input type="button" id="toggle_button" value="TEST" />


</div>
        <div id="two" class="two"><span id=''three' class="three">Click here to continue...</span></div>

      </p>
<script>
        $('#toggle_button').click(function () {
          $("#two").fadeIn(3000, function () {
            $("#three").fadeIn(100);
          });
          return false;
        }); 

      </script>

      </body>
      </html>

How could i get somthing like the below to work with my code?

 <script type="text/javascript">

    $(function() {

        var cookie = document.cookie,
            state  = cookie.substr(cookie.search('buttonCollapsed=')+16,1),
            elem   = $('div.collapsable');

        if (state == 1) {
            elem.hide();
        }

        elem.slideToogle(function() {

            if ( elem.is(':visible') ) {
                document.cookie = "toggle_button=0";
            } else {
                document.cookie = "toggle_button=1";
            }

        });

    });
    </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:17:30+00:00Added an answer on June 14, 2026 at 9:17 am

    You can see how to use cookie with jQuery in here sorry cookie page of jQuery website doesn t response right now.

    What you should do id set the the cookie on every click event;

    $.cookie("lastOne", this.id);
    

    and on document ready function check if the cookie exists and open the given id;

    $(document).ready(function () {
          if ($.cookie("lastOne") != null)
              $("#" + $.cookie("lastOne")).click();
    });
    

    that should do the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for some help with the following. This will be a very general
I'm fairly new with classes, and I've been looking online for some kind of
I know I can easily work around this, but I'm looking for the best
I've been looking for ways of solving this problem for quite some time now.
Hello I've been looking around at all the various tutorials out there for Paperclip
Hello I have been having trouble with this for a while now. I have
Hello everyone I've been trying to put some objects in an ASP.NET list box
I have been looking all over the Internet for an answer to this question
Hello internet, I have been looking for the past two hours for a script
Introduction : Hello Everyone, I have been looking for days for a way to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.