title: newline markup in textarea
body: <pre><code>   &lt;script&gt;
          $('#textarea_').on('keyup', function () {
              var textareaContentWithJquery = $('#textarea_').val();
              var textareaContentWithJavascript = document.getElementById('textarea_').value;
          });
      &lt;/script&gt;
  
          &lt;textarea cols="20" id="textarea_" name="textarea_" rows="2"&gt;
  Some text in textarea here is created without pressing enter, 
  just plain text. But how can i get the position 
  of  newline markup from textarea so that i can put &lt;br&gt; there? 
          &lt;/textarea&gt;
  </code></pre>
  
  <p>i get value from textarea  like that(plain text);
  Some text in textarea here is created without pressing enter, just plain text. But how can i get the position of  newline markup from textarea so that i can put <code>&lt;br&gt;</code> there?</p>
  
  <p>If I were to press enter in textarea and pass to new line then it would be easy because there would be an <code>\n</code> at the place where I press enter but when I just add text and let the textarea wrap the text to a new line then I have no <code>\n</code> there in the text.</p>
  
  <p>I need it to be like this (not plain text) ; </p>
  
  <pre><code>Some text in textarea here is created without pressing enter,\n
  just plain text. But how can i get the position\n
  of  newline markup from textarea so that i can put &lt;br&gt; there?\n
  
  So i would easily replace \n with &lt;br&gt; 
  Some text in textarea here is created without pressing enter,&lt;br&gt; 
  just plain text. But how can i get the position&lt;br&gt; 
  of  newline markup from textarea so that i can put &lt;br&gt; there? &lt;br&gt;
  </code></pre>
  
  <p>textareaContentWithJquery and textareaContentWithJavascript gives the same result i mean without <code>\n</code> markup. So they are useless.</p>