HTML tags that have not been touched before, HTML tags

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.