A textaera object as to a value (See this w3scholls.com page).
Then is to possible to write :

document.getElementById('txt').value = x;