Can an input field have two labels?

后端 未结 3 1329
一整个雨季
一整个雨季 2020-12-08 08:56

Mary had a little form, and its fields where labeled just so.
Whenever an error crept in, confusion it would sow.

I\'ve got a label for each input field

3条回答
  •  不思量自难忘°
    2020-12-08 09:43

    I assume this question is about HTML forms. From the specification:

    The LABEL element may be used to attach information to controls. Each LABEL element is associated with exactly one form control.

    Thus, each form control can be referenced by multiple labels, but each label can only reference one control. So if it makes sense to have a second label for a control (and in the situation you describe, it does) feel free to add a second label.

提交回复
热议问题