Home  >  Article  >  Web Front-end  >  Detailed explanation of how Html Select option makes default selection

Detailed explanation of how Html Select option makes default selection

高洛峰
高洛峰Original
2017-03-06 15:33:582201browse

Html Select The default selection is very simple. You only need to add the selected = selected attribute to an option to make it the default option. There is an example below. You may wish to refer to it. Adding the selected = "selected" attribute to an option is the default option

For example:

The code is as follows:

<select id="isAudit" name="isAudit"> 
<option value="2">全部</option> 
<option value="1" selected = "selected">通过</option> 
<option value="0">未通过</option> 
</select>


Then "pass" is the default Selected.

For more detailed explanations on how to make the default selection of Html Select option, please pay attention to the PHP Chinese website for related articles!

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