Code Chigga Code Chigga - 2 days ago 5
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:

[HideForever](https://jsfiddle.net/PeterzH/rxawdxkw/)


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

Answer

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').

Comments