Home  >  Article  >  Web Front-end  >  How to use the form control select tag

How to use the form control select tag

清浅
清浅Original
2018-12-11 14:43:446957browse


The form control select tag is used to create a drop-down list. The 5a07473c87748fb1bf73f23d45547ab8 tag is used to define the available options and other attributes to set the selection characteristics of the form control. Count etc.

What I will introduce today is the usage of form control select in HTML. It has certain reference value and I hope it will be helpful to everyone.

【Recommended course: HTML tutorial

How to use the form control select tag

##select tag

select is used to create drop-down lists and can be used to accept user input in forms. The 5a07473c87748fb1bf73f23d45547ab8 tag in its element is mainly used to define the available options in the list.

Example: through select Implementation of drop-down menu case

 <select style="width:100px;height:30px;">
        <option>打球</option>
        <option>运动</option>
        <option>看电视</option>
    </select>

The rendering is as follows:

How to use the form control select tag

select attributes:


select has the following three new attributes in HTML5:



autofocus: refers to the text area will be changed after the page is loaded. Automatically obtain focus. Note that Internet Explorer 9 and earlier versions do not support the autofocus attribute of the 221f08282418e2996498697df914ce4e tag.

form: Indicates one or more forms to which the text area belongs. Note that Internet Explorer does not support the form attribute.

required: refers to the range of the text area and this attribute is required. This attribute is currently not supported by all mainstream browsers.

size: refers to the number of visible options in the drop-down list.

disabled: Indicates that the use of the drop-down list is prohibited.

multiple: Indicates that multiple options can be selected.

name: refers to the name of the drop-down list.

Example: Set the visible bibliography of the drop-down list to 2 and you can select multiple options

 <select style="width:100px;height:40px;" multiple="multiple" size="2">
        <option>打球</option>
        <option>运动</option>
        <option>看电视</option>
    </select>

The rendering is as follows:


How to use the form control select tag

Summary: The above is the entire content of this article. I hope that through this article, everyone can understand and use the select tag.

The above is the detailed content of How to use the form control select tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more