How to insert data into Textarea in JavaScript

You can do this both with innerHTML and value.

Example 1:

<textarea id="myTextarea"></textarea>

<script>
    document.getElementById('myTextarea').innerHTML = 'Text added with innerHTML';
</script>

Output:

Example 2:

<textarea id="myTextarea"></textarea>

<script>
    document.getElementById('myTextarea').value = 'Text added with value';
</script>

Output: