title: Get label for input field
body: <p>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 is to get an alert() with all fields lined up that is not filled out. And not an alert() for each.</p>
  
  <p>Here is a fiddle: <a href="http://jsfiddle.net/s7pYX/" rel="noreferrer">http://jsfiddle.net/s7pYX/</a></p>
  
  <p>How is this accomplished?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div&gt;
  &lt;label for="txtName"&gt;Name&lt;/label&gt;
  &lt;input type="text" id="txtName" class="form-control" name="txtName"&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
  &lt;label for="txtEmail"&gt;E-mail&lt;/label&gt;
  &lt;input type="text" id="txtEmail" class="form-control" name="txtEmail"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Jquery:</p>
  
  <pre><code> $('input').each(function(){
   if ($(this).val() == '') {
  
   $element = $(this)
  
   var $label = $("label[for='"+$element.attr('id')+"']")
  
   alert($label)    
  
   }
  
   });  
  </code></pre>
  
  <p>In the alert() I expect like this "You need to fill out: Name, E-mail"</p>