title: How to save background color in cookie through button click?
body: <p>Im currently trying to learn about cookies in javascript.</p>
  
  <p>My question is : I have three Button Red-Green-Blue and if i click for example on red, the background color red should be saved within a cookie so that i reload the webpage its colored red.</p>
  
  <pre><code>document.cookie ="red";
  document.cookie ="green";
  document.cookie ="blue";
  function BackgroundRed(){
  document.cookie = "background-color=red";
  }
  
  
  &lt;button onClick="BackgroundRed()" style="background-color:red"&gt;Rot&lt;/button&gt;
  &lt;button onClick="alertCookie()" style="background-color:green"&gt;Grün&lt;/button&gt;
  &lt;button onClick="alertCookie()" style="background-color:blue"&gt;Blau&lt;/button&gt;
  </code></pre>