I have an array, each of its elements in a text line:
a = ['line1', 'line2', 'line3'];
I want to set the text lines into a textarea, displayed like so:
line1
line2
line3
I set the text with the following code:
myTxtArea.value = a.join('\n');
and it shows like this:
line1\nline2\nline3
What to do so that the \n
's break lines instead of being displayed?
The textarea HTML:
<textarea autofocus id=laidTxt name=laidTxt class="laidTxt"
placeholder="paste PDF text here">KJHKH DSKJH ...
</textarea>
I see