Alright, I know how the fieldset/legend works out in HTML. Say you have a form with some fields:
<form> <fieldset> <legend>legend</legend> <input name='input1' /> </fieldset> </form>
What should I use the legend for? It’s being displayed as a title, but isn’t a legend semantically an explanation of the contents? In my view, preferably you’d do something like this:
<form> <fieldset> <legend>* = required</legend> <label for='input1'>input 1 *</label><input id='input1' name='input1' /> </fieldset> </form>
But that doesn’t really work out with how fieldsets are rendered. Is this just a ambigious naming in HTML, or is it my misunderstanding of the English word ‘legend’?
Edit: fixed some errors 😉
Yes, the naming is ambiguous. It’s best to consider it as a caption for the fieldset.
See the HTML spec on
FIELDSETandLEGENDelements if you haven’t already: