HTML tags that have not been touched before, HTML tags
HTML tags used for forms
HTML <fieldset> label
Define and use the fieldset element to group related elements in the form.
<Fieldset> the label packs a part of the Form Content and generates a set of related form fields.
<Legend> the label defines the title for the fieldset element.
Fieldset definition domain legend definition domain title
1 <form> 2 <fieldset> 3 <legend> User form </legend> 4 <input type = "text" value = ""> 5 <input type = "text" value = ""> 6 </fieldset> 7 </form>
HTML <optgroup> label
Optgroup
The optgroup element is used to combine options. When you use a long option list, it is easier to combine related options.
1 <select> 2 <optgroup label="Swedish Cars"> 3 <option value="volvo">Volvo</option> 4 <option value="saab">Saab</option> 5 </optgroup> 6 <optgroup label="German Cars"> 7 <option value="mercedes">Mercedes</option> 8 <option value="audi">Audi</option> 9 </optgroup>10 </select>
HTML <label> label
Definition and usage
<Label> A tag defines a tag for an input element ).
The label element does not present any special effects to users. However, it improves availability for mouse users. If you click Text in the label element, this control is triggered. That is to say, when the user selects the tag, the browser automatically redirects the focus to the form control related to the tag.
<Label> The for attribute of a tag must be the same as the id attribute of the relevant element.
Note: The "for" attribute can bind a label to another element. Set the value of the "for" attribute to the value of the id attribute of the relevant element.