looping through an array in jQuery -
i'm trying create array of textarea values , loop through them.
here jsfiddle trying work in:
when run it, nothing happens.
any idea i'm doing wrong?
var textarray = []; $('[class=objectives]').each(function (i) { textarray.push($(this).val()); }); (var = 0; < textarray.length; i++) { console.log(textarray[i].value); }
there no value
property in each element, can do:
for (var = 0; < textarray.length; i++) { console.log(textarray[i]); }
working demo - note: jquery wasn't included
Comments
Post a Comment