I have multiple textarea for example:
<textarea>test1</textarea>
<textarea>test2</textarea>
<textarea>test3</textarea>
I know how to iterate over all the textareas and get the values:
$(function(){
$("textarea").each(function(){
alert(this.value);
});
});
But how to store each textarea at a different index?
This doesn't work:
var myArray=[];
$(function(){
$("textarea").each(function(){
myArray.push(this.value);
});
});
Doesn't matter if it's with JS or Jquery