[whatwg] <summary> and <details> elements' specification

Aryeh Gregor Simetrical+w3c at gmail.com
Mon Apr 11 15:22:27 PDT 2011


On Mon, Apr 11, 2011 at 11:58 AM, Jukka K. Korpela <jkorpela at cs.tut.fi> wrote:
> Not necessarily. The for="..." attribute could be made optional, so that the
> default association is to associate the <summary> attribute with the next
> sibling element.
>
> (I wonder why the association between <label> elements and input fields has
> not been defined this way. It's too late now, but things aren't too late for
> <details>.)

If <label> has no "for" attribute, it labels its first labelable
descendant.  E.g.,

    <label>Name: <input></label>

means the same as

    <label for=name>Name: <input id=name></label>

http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#the-label-element



More information about the whatwg mailing list