EN
JavaScript - set textarea field value
7 points
In this short article, we would like to show how to set textarea value using JavaScript.
Quick solution:
xxxxxxxxxx
1
<textarea id="my-textarea">Some text here ...</textarea>
2
<script>
3
4
var element = document.querySelector('#my-textarea');
5
6
element.value = 'Some updated text here ...';
7
8
</script>