<div class="cardtitle">WEB</div>
<textarea id="web">
abc
abc
abc
</textarea>
<div id="btnprint">PRINT</div>
JS verlorenSchreiben auf einem neuen Fenster - neue Linien
tosend = '';
$('#btnprint').click(function(){
$('.cardtitle').each(function(){
tosend = tosend +
$(this).text().toUpperCase() + '<br>' +
$(this).next().val() +
'<hr>'
});
w=window.open();
w.document.write(tosend);
w.print();
w.close();
});
Ergebnis ist abc abc abc
Statt:
abc abc abc
Neue Linien sind verloren.
Sie müssen in '$ (this) .text()' mit ''
all Zeilenumbrüche ersetzen. – Barmar
Oder wickeln Sie '
' um 'tosend'. – Barmar