title: Howe can I save more strings in cookie and place them in list?
body: <p>mI have the next javascript code:</p>
  
  <pre><code>    function setCookie(cname,exdays) {
      var d = new Date();
      d.setTime(d.getTime() + (exdays*24*60*60*1000));
      var expires = "expires=" + d.toGMTString();
      document.cookie= cname+"; "+expires
  }
  function delCookie(cname) {
      document.cookie = cname + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
  }
  function change(cname) {
      var elem = document.getElementById("but");
      if (elem.style.backgroundColor=="pink") 
      {
          elem.style.backgroundColor="#ff5d6d";
          delCookie(cname);
      }
      else {
          elem.style.backgroundColor="pink";
          setCookie(cname);
      }
  }
  </code></pre>
  
  <p>I have made few buttons to add a string by clicking it once and remove it by clicking it again. but it just saves 3 times after the 3 one he replace the string with the old one. I want to save more strings in a cookie. and when i write document.writeln(document.cookie) i want to place the strings between each other. Iam making a favorite buttun that save the string and add it to another page.</p>