The second and third ones there aren't really all that complex or hard.
For the second one, you just use the standard self-invoking anonymous function and you allow HTML elements to interact with it by specifying (for example) dummy class names, where the class name(s) tell your JS code what to do.
The third one is truly simple: cookies. And you could implement it with the same self-invoking anonymous function used in the second answer, so it's easy to combine those two.
In fact, you can easily fulfill both those by, for example. using a class name on various form fields or other user choices to indicate a value that needs to be stored in the cookie and then restored on page load.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.