title: html encode <textarea> value
body: <p>How do I get the latest updated typed in value of a textarea and html encode the value.</p>
  
  <p>To get the value I use:</p>
  
  <pre><code>$('textarea').val(); // this works cross browser
  </code></pre>
  
  <p>But if the value was <code>"sdfgsdgdsgsdg &lt;br/&gt;"</code>     how do I HTML encode it?</p>
  
  <p>It breaks when I <code>stringify()</code> it</p>
  
  <pre><code>var e = { "d" : $('textarea').val()};
  var s = JSON.stringify(e); //it breaks here
  </code></pre>