title: What does "for" attribute do in an HTML <label> tag?
body: <p>I wonder what is the difference between the following two code snippets:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;label&gt;Input here : &lt;/label&gt;
  &lt;input type='text' name='theinput' id='theinput'/&gt;
  </code></pre>
  <p>and</p>
  <pre class="lang-html prettyprint-override"><code>&lt;label for='theinput'&gt;Input here : &lt;/label&gt;
  &lt;input type='text' name='theinput' id='theinput'/&gt;
  </code></pre>
  <p>I'm sure it does something when you use a special JavaScript library, but apart from that, does it validate the HTML or required for some other reason?</p>