I have added a background color change effect to my website. Now I want that change to apply to all my other pages. I'm having trouble understanding cookie functions, so some context with what I'm working on would really help.
My JS:
function background(color){document.body.style.backgroundColor=color;}
My HTML:
<tr><td class="bggreen" style="cursor: pointer" onclick="background('green')"> </td></tr>
My CSS:
.bggreen { background-color: green; }
The code all works fine, so some of this info might be pointless. It's just, if I were to construct a cookie to make these color changes apply to all relevant pages in my site, how would I go about? No preference to whether PHP or JS is used. I would just like what comes most practically.