W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2007

[whatwg] Proposal: Allow block content inside label element

From: Brad Fults <bfults@gmail.com>
Date: Mon, 7 May 2007 20:46:57 -0700
Message-ID: <1959130b0705072046y70512895j2ea9caf9b80a6c62@mail.gmail.com>
Currently, as far as I can tell, in HTML 4 [1] and HTML 5 [2], the
label element is defined as having inline content. When using the
implicit form control association pattern described in the HTML 4 spec
(e.g. a form control inside of the label element instead of or in
addition to using the |for| attribute), this becomes a problem.

Specifically, if one tries to place a textarea element inside of a
label element, modern browsers will insert the textarea as a later
sibling to the label in the DOM instead of as a child. This seems to
be due to the fact that the textarea is a block element and that label
can't contain it according to the spec.

Could we remedy this by allowing block content inside of a label element?

Thanks.

[1] - http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL
[2] - http://www.whatwg.org/specs/web-apps/current-work/multipage/section-forms.html#the-label

-- 
Brad Fults
Received on Monday, 7 May 2007 20:46:57 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:55 UTC