JSFiddle - React, Tailwind, and code Playground
HTML
<p>Show the alert, hit Ctrl/Cmd + C, hit OK, then paste the result into the textarea.</p>
<form>
<p><button type="button">Show alert</button></p>
<p><textarea></textarea></p>
</form>
JavaScript
document.getElementsByTagName('button')[0].onclick = function () {
alert('This\r\nis\r\na\r\ntest');
document.getElementsByTagName('textarea')[0].focus();
};