Creating a Simple Style Switcher

I see quite a few questions on how to persist state (of a checkbox, for example) between page reloads, so decided to write a tutorial on how this might be achieved.

In the tutorial I show how to make a simple style switcher, not because the world needs another style switcher, but rather to demonstrate this technique using a half-way to realistic example. I also took the opportunity to show how to attach event handlers unobtrusively (without jQuery) and manipulate an element’s style.

Read the complete article on SitePoint

I'm on Twitter: