Load lines into textarea
by Juan Lanus
HTML
<textarea autofocus id=laidTxt name=laidTxt class="laidTxt"
rows="5" cols="33" wrap="off" placeholder="paste here">
</textarea>
<button
onClick="
const txtArea = getElementById( 'laidTxt' );
let txt = txtArea.value.toUpperCase().split( '\n' );
txtArea.value = txt.join( '\n' );
txtArea.select();
">go</button>
JavaScript
const lines = [ 'line1', 'line2', 'line3' ];
window.addEventListener(
'load',
( event ) => {
document.getElementById( 'laidTxt').value = lines.join( '\n' );
}
);