title: Save a div content in a cookie
body: <p>First of all, in my site DIV's are dynamically added, with a unique ID (like div0, div1, div2...). Those DIV's can be added or deleted by the user: when added, an array store the DIV unique ID; when deleted, the same array delete the DIV id. 
  All those DIV's have a lot of input fields, and I want to store this content (even if it's blank). I've searched for a solution and I found something like that:</p>
  
  <pre><code>var numCookies=0;
  function setCookie(){
      var name;
      for(var i=0; i&lt;arrayDivs.length; i++){//ArrayDivs is the array with the DIV id's.
            name='cookie'+numCookies;
            $.cookie(name, $('#'+arrayDivs[i]).html(),{expires:10});                 
            numCookies++;                                                         
      }
  } 
  </code></pre>
  
  <p>When I try to "show" (alert) - for example - 'cookie0', the alert is "null". </p>
  
  <pre><code>name='cookie0';
  alert(name);
  var myCookie=($.cookie(name));
  alert(myCookie); //here the alert is 'null'
  </code></pre>
  
  <p>At least 1 div is created, so the "arrayDivs" isn't empty, and the "cookie0" is created.
  Obviously I'm doing something wrong (very wrong haha). How can I store a DIV (and all it's content) in a cookie? If this implementation isn't completely wrong, how can I fix it?
  Thanks in advance.</p>