[ACCEPTED]-Read multiple jQuery.val() into array-iteration

Accepted answer
Score: 27

Found a solution thanks to Dogbert. All 2 that was missing in his example was the 1 .get()

Here is the solution i ended up using:

var info = $('[id^="info_"]').map(function () { return $(this).val(); }).get();
Score: 24

You can use jQuery.map

var info = $('[id^="info_"]').map(function() { return $(this).val(); } )

0

Score: 2
$('[id^="info_"]').each(function(){ info.push($(this).val()); });

should do

0

More Related questions