<textarea id='message'>
1行目
2行目
3行目</textarea>
const message = document.getElementById('message').value;
console.log(message);
const messages = message.split(/\n/);
console.log(messages);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.