I\'m doing a validation with Jquery and need to get the $label from each element with their own label. Now the alert() gives med [object object]. The best thing for me here
var response = ""; $('input').each(function(){ if ($(this).val() == '') { response += ", " + $('label[for="' + this.id + '"]').html(); } }); alert(response.replace(", ", "You need to fill out: "));