title: How to preserve a line break
body: <p>Line breaks and carriage returns... Must be the most complicated part of coding. (for me)</p>
  
  <p>Have this code in a page (which came from database stored as <code>This from Ricardo\nAnd also a test\nRent 3000.00</code>):</p>
  
  <pre><code>&lt;td title="This from Ricard
  And also a test
  Rent 3000.00" style="width:198px;text-align:left"&gt;....&lt;/td&gt;
  </code></pre>
  
  <p>Then use this to get the title attribute with 'hidden' \n's</p>
  
  <pre><code>var v = $('#'+i).parent().attr('title');        // i = id of &lt;span&gt; child of &lt;td&gt;
  </code></pre>
  
  <p>Along the way, the line breaks get lost and using the variable v into a text input box:</p>
  
  <pre><code>This from RicardAnd also a testRent 3000.00
  </code></pre>
  
  <p>What does it take to preserve the <code>\n's</code> and have this look instead like below?</p>
  
  <p><img src="https://i.stack.imgur.com/Smqzt.png" alt="Screenshot of desired result (with \n&#39;s present) after clicking edit"></p>