var justr=false, justn=false, justrn=false; var twentythree=-1, tts=''; function whichd(ofo) { //alert(90); var dv=document.getElementById('thistitle').value; var dvs=document.getElementById('thistitle').value.split(String.fromCharCode(13) + String.fromCharCode(10)); twentythree=23; tts=String.fromCharCode(13) + String.fromCharCode(10); //alert('' + dvs.length); if (eval('' + dvs.length) <= 1) { dvs=document.getElementById('thistitle').value.split(String.fromCharCode(10)); if (eval('' + dvs.length) != 0) { twentythree=10; tts=String.fromCharCode(10); } } if (eval('' + dvs.length) <= 1) { dvs=document.getElementById('thistitle').value.split(String.fromCharCode(13)); if (eval('' + dvs.length) != 0) { twentythree=13; tts=String.fromCharCode(13); } } if (eval('' + encodeURIComponent(dv).length) < 800) { //alert(91); setTimeout(whichdofo, 2000); return false; } return whichdofo(); } function whichdofo() { var dv=document.getElementById('thistitle').value; var wasv=dv; var dvs=document.getElementById('thistitle').value.split(String.fromCharCode(13) + String.fromCharCode(10)); twentythree=23; tts=String.fromCharCode(13) + String.fromCharCode(10); if (eval('' + dvs.length) <= 1) { dvs=document.getElementById('thistitle').value.split(String.fromCharCode(10)); if (eval('' + dvs.length) != 0) { twentythree=10; tts=String.fromCharCode(10); } } if (eval('' + dvs.length) <= 1) { dvs=document.getElementById('thistitle').value.split(String.fromCharCode(13)); if (eval('' + dvs.length) != 0) { twentythree=13; tts=String.fromCharCode(13); } } if (eval('' + encodeURIComponent(document.getElementById('thistitle').value).length) < 800) { document.getElementById('myform').method='GET'; if (justrn && twentythree == 23) { location.href=document.URL.split('#')[0].split('?')[0] + '?thistitle=' + encodeURIComponent(wasv); return false; } if (justr && twentythree == 13) { location.href=document.URL.split('#')[0].split('?')[0] + '?thistitle=' + encodeURIComponent(wasv); return false; } if (justn && twentythree == 10) { location.href=document.URL.split('#')[0].split('?')[0] + '?thistitle=' + encodeURIComponent(wasv); return false; } if (justrn) { if (twentythree == 13) { while (wasv.indexOf(String.fromCharCode(13)) != -1) { wasv=wasv.replace(String.fromCharCode(13),'~!@#'); } wasv=wasv.replace(/\~\!\@\#/g, String.fromCharCode(13) + String.fromCharCode(10)); } else if (twentythree == 10) { while (wasv.indexOf(String.fromCharCode(10)) != -1) { wasv=wasv.replace(String.fromCharCode(10),'~!@#'); } wasv=wasv.replace(/\~\!\@\#/g, String.fromCharCode(13) + String.fromCharCode(10)); } } else if (justr) { if (twentythree == 23) { while (wasv.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { wasv=wasv.replace(String.fromCharCode(13) + String.fromCharCode(10),'~!@#'); } wasv=wasv.replace(/\~\!\@\#/g, String.fromCharCode(13)); } else if (twentythree == 10) { while (wasv.indexOf(String.fromCharCode(10)) != -1) { wasv=wasv.replace(String.fromCharCode(10),'~!@#'); } wasv=wasv.replace(/\~\!\@\#/g, String.fromCharCode(13)); } } else if (justn) { if (twentythree == 23) { while (wasv.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { wasv=wasv.replace(String.fromCharCode(13) + String.fromCharCode(10),'~!@#'); } wasv=wasv.replace(/\~\!\@\#/g, String.fromCharCode(10)); } else if (twentythree == 13) { while (wasv.indexOf(String.fromCharCode(13)) != -1) { wasv=wasv.replace(String.fromCharCode(13),'~!@#'); } wasv=wasv.replace(/\~\!\@\#/g, String.fromCharCode(10)); } } location.href=document.URL.split('#')[0].split('?')[0] + '?thistitle=' + encodeURIComponent(wasv); return false; } if (justrn && twentythree == 23) { return true; } if (justr && twentythree == 13) { return true; } if (justn && twentythree == 10) { return true; } //alert(8); if (justrn) { if (twentythree == 13) { while (document.getElementById('thistitle').value.indexOf(String.fromCharCode(13)) != -1) { document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(String.fromCharCode(13),'~!@#$'); } document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(/\~\!\@\#\$/g, String.fromCharCode(13) + String.fromCharCode(10)); } else if (twentythree == 10) { while (document.getElementById('thistitle').value.indexOf(String.fromCharCode(10)) != -1) { document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(String.fromCharCode(10),'~!@#$'); } document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(/\~\!\@\#\$/g, String.fromCharCode(13) + String.fromCharCode(10)); } } else if (justr) { if (twentythree == 23) { while (document.getElementById('thistitle').value.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(String.fromCharCode(13) + String.fromCharCode(10),'~!@#$'); } document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(/\~\!\@\#\$/g, String.fromCharCode(13)); } else if (twentythree == 10) { while (document.getElementById('thistitle').value.indexOf(String.fromCharCode(10)) != -1) { document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(String.fromCharCode(10),'~!@#$'); } document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(/\~\!\@\#\$/g, String.fromCharCode(13)); } } else if (justn) { if (twentythree == 23) { while (document.getElementById('thistitle').value.indexOf(String.fromCharCode(13) + String.fromCharCode(10)) != -1) { document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(String.fromCharCode(13) + String.fromCharCode(10),'~!@#$'); } document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(/\~\!\@\#\$/g, String.fromCharCode(10)); } else if (twentythree == 13) { while (document.getElementById('thistitle').value.indexOf(String.fromCharCode(13)) != -1) { document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(String.fromCharCode(13),'~!@#$'); } document.getElementById('thistitle').value=document.getElementById('thistitle').value.replace(/\~\!\@\#\$/g, String.fromCharCode(10)); } } return true; } function justrntrue() { justrn=true; justr=false; justn=false; //alert('here'); } function justntrue() { justn=true; justr=false; justrn=false; } function justrtrue() { justr=true; justrn=false; justn=false; } function tc() { if (" . strlen($tval) . " != 0) { document.title=document.getElementById('mydiv').textContent; //alert(document.getElementById('mydiv').textContent); } }

Carriage Return and/or Linefeed

RJM Programming - April, 2022
Proving javascript - Why carriage return not rendered as a line break when assigned to textContent although formatted using pre? - Stack Overflow

Hover or click main heading up the top to see, reflected, the textarea record delimiter arrangement the button you pressed suggests

... textarea above vs pre element below ...


display:inline-block;display:block;
" . $tval . "
" . $tval . "
" . $tval . "


... vs span element below ...


" . $tval . "

... vs div element below ...


display:inline-block;display:block;
" . $tval . "
" . $tval . "
" . $tval . "


    
"; ?>