Code Chigga Code Chigga - 1 year ago 84
jQuery Question

How do you hide a div using localStorage?

I been playing with windows.localStorage and couldn't figure out how to save variable. So far I know how to store text but how do you keep something being True
Anyway I have this code demo here:


, and feel free to use jQuery if you have to
Thanks for the help :)

Answer Source

Values you save in localStorage are Strings only.

You can't use any other types (not boolean, not objects).

You can use the strings '0'/'1' (and later on check if the value == '0' or == '1').

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download