Form Controls in HTML: Grouping Form Controls

<jieldset>… </fleldset>/<legend>… </legend>

The <fieldset> element groups together a set of controls and draws a border around them. The <legend> element adds caption to the border to describe the content of the group. While the <legend> element has no native attributes, the <fieldset> element takes the three attributes listed in Table 5.18. The legend should be brief and descriptive, especially because screen readers usually read it out for each control in the fieldset. Figure 5.57 shows the element in use, and Figure 5.58 depicts the result.

Source: Sklar David (2016), HTML: A Gentle Introduction to the Web’s Most Popular Language, O’Reilly Media; 1st edition.

Leave a Reply

Your email address will not be published. Required fields are marked *