Your sample returns a value only in the first element of the array. You need to iterate over the array, and you can use each . The jQuery syntax syntax returns a jQuery object that contains the mapped objects as an array.
You can also use another variant of $.each , so ...
var test_arr = $("input[name*='man']"); $.each(test_arr, function(i, item) {
Since the jQuery return object is an array of matching elements, you can also use the traditional for loop ...
//you can also use a traditional for loop for(var i=0;i<test_arr.length;i++) { alert($(test_arr[i]).val()); }
David hoerster
source share