Well, running the map method on an jQuery method doesn't transform it into an array.... therefore, your variables arr1 and arr2 are still jQuery objects....
First, it's easier to collect all IDs directly from the selector: var myarray = $("#employees input[id$='Bonus'], #employees input[id $='Salary']").map(function() { return $(this).attr("id"); }); Now, myarray is an jQuery object containing all the properties like any other jQuery object, but also all IDs as objects inside "inexed" keys... This should work: $.each(myarray, function() { alert(String(this)); });