title: New Line in Textarea to be converted to <br/>
body: <p>There's a lot of threads here about converting br/> or preserving newlines across different languages, but not many regarding textarea.</p>
  
  <p>I have this script:</p>
  
  <pre><code>var boxText = "";
  $("textarea.BoxText").live('dblclick', function () {
      boxText = $(this).val().replace(/ /g, "&lt;br/&gt;");
    $(this).replaceWith( '&lt;div class="BoxText"&gt;' + $(this).val() + '&lt;/div&gt;' );
  
  });
  $("div.BoxText").live('dblclick', function () {
    $(this).replaceWith( '&lt;textarea form="HTML" class="BoxText"&gt;' + boxText + '&lt;/textarea&gt;' );
  });
  </code></pre>
  
  <p>I have a textarea element, editable. When the user double-clicks on it, it converts into a div. However, in a div, the newlines are not preserved. I would like to convert just the new lines into <br/>, currently, all spaces are being converted. I have a second script that converts it back to textarea, hence the variable for storing the string. I would need the <br/>'s to be reconverted into new lines as well.</p>
  
  <p>This may seem redundant, but i have a good reason for this.</p>