I never had a reason to place a label element inside a legend element (I never thought about it or saw it). But with the project that I am implementing, it makes me think.
Here is what I am experiencing:
<fieldset>
<legend><label for="formInfo">I would like information on</label></legend>
<select id="formInfo">
<option value="Cats">Cats</option>
<option value="Dogs">Dogs</option>
<option value="Lolz">Lolz</option>
</select>
</fieldset>
It works as expected (clicking on the shortcut focuses the corresponding input) in Firefox3, Safari, Opera and IE6 / 7, and it passes the test, but I'm just wondering if there are any known reasons (accessibility? Semantics? Browser issues) why it should not be done
source
share