title: Avoiding repetition with <label>
body: <p>When I'm coding a form I find myself doing some very repetitive typing.  For example, if I'm lining up a number of <code>&lt;input&gt;</code>s in a table, I might write</p>
  
  <pre><code>&lt;tr&gt;
    &lt;td&gt;&lt;label for="repeat"&gt;Repeat:&lt;/label&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input id="repeat" name="repeat"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>where the third <code>"repeat"</code> is needed for GET/PUT form submission, the first and third are associated with each other, the third is for DOM access, and the second is for the (human) reader.</p>
  
  <p>If I avoid lining up the various inputs the need for the first goes away:</p>
  
  <pre><code>&lt;p&gt;&lt;label&gt;Repeat: &lt;input id="repeat" name="repeat"&gt;&lt;/label&gt;&lt;/p&gt;
  </code></pre>
  
  <p>but usually I'm asked to make them line up.</p>
  
  <p>Generally, I think of duplications in code (DRY) as a bad thing, so even minor as this is I thought I'd ask to see if there was a better way.  As it stands, I have four opportunities for typos, three of which are user-facing and two which would cause programmatic issues if mistyped.</p>