The issue seems to be simple, but I really don't understand. Why the alert window is blank after I type something in the textarea and press the button?
const source = document.querySelector('textarea#source').textContent;
document.querySelector('button').addEventListener('click', function() {
alert(source);
});
<textarea id="source" rows="25"></textarea>
<button>click me</button>