EN
JavaScript - get textarea field value
9 points
In this short article, we would like to show how to get 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
console.log(element.value); // Some text here ...
7
8
</script>