title: How add \n to enter key press
body: <p>I need add '\n' to my text area tag when user press Enter key. Because default enter add only visual new string, if i copy text from text area in other place i have one string.<br>
  If i try</p>
  
  <pre><code> $('.body__textarea').on('keydown', function (e) {
     if ( e.keyCode === 13 ) {
       e.preventDefault();
       const oldValue = $(this).val();
       const newValue = oldValue + '\n'
       $(this).val(newValue);
     }  
   })
  </code></pre>
  
  <p>New line adds in the end of string, but need where is caret.</p>
  
  <p>Code example <a href="https://codepen.io/kostikovmu/pen/oNXqmoM" rel="nofollow noreferrer">https://codepen.io/kostikovmu/pen/oNXqmoM</a></p>