JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="1" class="myTextArea">
123
</textarea>
<textarea id="2">
456
</textarea>
JavaScript
//alternative 1
$(function() {
$('textarea').each(function() {
alert($(this).text())
})
})
//alternative 2 only those who has specific class
$(function() {
$('textarea.myTextArea').each(function() {
alert($(this).text())
})
})
//alternative 3, handpicked textareas
$(function() {
var handPicked = ['#2', '.myTextArea']
for (x = 0; x < handPicked.length; x++) {
alert($(handPicked[x]).text())
}
})