title: JavaScript - Getting Multiline value from textarea
body: <p>I wanted to get a Multiline value from textarea using js or jquery and save it to a cookie. Here's how the code looks like:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;textarea id="cont" cols="72" rows="15"&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var txt = $('#cont').val();
  </code></pre>
  
  <p>The variable 'txt' saves to a cookie well when it's not a multi line one, but it don't save when it has more than one line.</p>
  
  <p>Here's my set cookie:</p>
  
  <pre><code>function SetCookie(cookie_name, data){
  var domain = wgServer.split("//")[1];
  document.cookie =
      cookie_name + "=" + data +
      "; max-age=" + 60*60*24*150 +
      "; path=/; domain=" + domain;
  }  
  </code></pre>