I am trying to identify an attribute within each object of an array of checked boxes, but this code returns the desired element of only the attribute of the first object in the array for the number of boxes that I have checked. Here is my code:
function() {
var checkedBoxes = $("[name='select-services']:checked");
checkedBoxes.each(function(){
console.log(checkedBoxes.attr("value"))
}
For example, if the values of three selected boxes are "value 1", "value 2", and "value 3", I will receive the output "value 1" three times.
thisinside theeachto get to the item being iterated over. (or use the second argument)