Using label instead of legend in the details element

Enter your zip code, you numpty

In the details spec, details should have a legend as a child - but that is unstylable.

This test examines what happens if you use a label instead. Normally, in a form, you use label for="id", giving the id of its matching field so clicking on the label puts focus into the form field instead.

Here, I'm not associating the label with anything else because the label is for the details element rather than a form field, so there seems to be no effect if you click on the label.

Also see a form inside a details element.

Screenreader support

Léonie Watson of Nomensa reports "Seems to be absolutely fine. Ran some quick tests with Jaws, NVDA, SA To Go and Window Eyes on IE8 and FF3.5. All treat the associated form label as expected, and the label inside the details tag as plain text".

Browser compatibility

The details element doesn't actually work yet in current browsers&,dash;it's supposed to hide all the contents except the label, and expand/ collapse the contents on activation. You need a script like Dean Edwards' HTML.js library to simulate that support. My point is that no-one will use these elements given the ugliness and unstylability of the legend element, as is currently specified.