title: Finding the label of an input field in Selenium Webdriver
body: <p>I have a form where each text box has a title. I already have the WebElement of the text boxes, and I want to reference their title (the title that has <code>"for=id"</code> pointing to them).</p>
  
  <p>I've tried their <code>getText</code> which only returns the text in the input box, tried <code>getCssValue("label")</code> which doesn't return with anything. I've tried finding all the labels but that doesn't help as I'd still have to sift through all of them, and find the 8 different labels that need to have the *.</p>
  
  <pre><code>&lt;label for="customer_firstname"&gt;First name &lt;sup&gt;*&lt;/sup&gt;&lt;/label&gt;
  &lt;input onkeyup="$('#firstname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_firstname" name="customer_firstname" value=""&gt;
  </code></pre>
  
  <p>I want to get back a string of the label text so I can check <code>(with .contains())</code>if it contains the <code>"*"</code>at the end. Preferably with as little Xpath as possible.</p>