title: Copy to clipboard with break line
body: <p>I want to copy a text to clipboard but in a new line.</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>If you click the button in the snippet and paste in the notepad this is what you gonna get:</p>
  
  <blockquote>
    <p>Name: testSurname: testEmail: test@gmail.comAddress: testCity: testCountry: nullAd Category: testPlan: nullWebsite: Company name: testΜήνυμα: test</p>
  </blockquote>
  
  <p><strong>What I want:</strong></p>
  
  <p>I want, if possible, to copy text in a newline. The same as it is when you copy it:</p>
  
  <blockquote>
    <p>Name: test
    <br>Surname: test
    <br>Email: test@gmail.com<br>
    ...</p>
  </blockquote>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function copyToClipboard(element) {
    var $temp = $("&lt;input&gt;");
    $("body").append($temp);
    $temp.val($(element).text()).select();
    document.execCommand("copy");
    $temp.remove();
  }
  
  $( "#FailCopy" ).click(function() {
    alert("Well done! div #error-details has been copy to your clipboard, now paste it in the notepad or email!");
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;!--text that i want to copy--&gt;
      &lt;h2&gt;Div #error-details: the text I want to copy to clipboard:&lt;/h2&gt;
      &lt;er id="error-details"&gt;Name: test&lt;br&gt;Surname: test&lt;br&gt;Email: test@gmail.com&lt;br&gt;Address: test&lt;br&gt;City: test&lt;br&gt;Country: null&lt;br&gt;Ad Category: test&lt;br&gt;Plan: null&lt;br&gt;Website: &lt;br&gt;Company name: test&lt;br&gt;Μήνυμα: test&lt;/er&gt;
  
      &lt;br&gt;&lt;br&gt;
      
      &lt;button id="FailCopy" type="button"  
       onclick="copyToClipboard('er#error-details')"&gt;Copy div to clipboard&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have also tried to replace <code>&lt;br&gt;</code> with <code>\n</code> and <code>\r\n</code> by adding the following css rule to my div: <code>white-space:pre-wrap;</code> without any signs of success.</p>