Reputation:
I've got some javascript which changes the background colour on mouse click:
<input type="button" name="colr" value=" Blue " onclick="document.bgColor='#0000FF'">
This works but once the page is reloaded or refreshed, it goes back to the original colour, I want to know how I could implement cookies or sessions into this to make it stay.
Upvotes: 2
Views: 221
Reputation: 42052
Javascripts native cookie handling is a pain. I strongly recommend using jquery and the excellent jquery cookie plugin. However, i believe your answer can be found here: http://www.quirksmode.org/js/cookies.html
Upvotes: 2