Link to home
Start Free TrialLog in
Avatar of James Allan
James Allan

asked on

How to let div toggle even if i refresh page

<button class="btn btn-default" data-toggle="collapse" data-target="#demo">More tools</button>

<div id="demo" class="collapse col-md-12" style="color: white; background-color: grey;">
Some tools here
</div>

Open in new window


As you can see, i am using my button to toggle my div.     (using Bootstrap toggle )

It is working, the problem is that when i change page my toggle div closes.
I want to keep it open, only close when user click close.
I think that i should use localstorage.
What is the best option for this?
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Allan
James Allan

ASKER

I was trying here to do something like this but no success.
Thx mate for helping