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
because you are sending an object
to the alert function, if you want to get the content of the selected label you have to get it's html
http://jsfiddle.net/s7pYX/2/
$('input').each(function(){
if ($(this).val() == '') {
$element = $(this)
var $label = $("label[for='"+$element.attr('id')+"']").html();
alert($label)
}
});