Home  >  Article  >  Web Front-end  >  How to set the default selection for Select option in Html

How to set the default selection for Select option in Html

php中世界最好的语言
php中世界最好的语言Original
2018-02-02 10:16:3811616browse

This time I will show you how to set the default selection for the Select option in Html. What are the precautions for setting the default selection for the Select option in Html? The following is a practical case. Let’s take a look. Add selected = "selected" to an option
Attribute

is the default option

For example:

<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.

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to the php Chinese website

Other

related articles!

Related reading:

How to set overflow when the html table is relatively wide


htmlHow to add attributes using style example


htmlHow to use the title attribute to display text where the mouse is hovering


htmlHow to use a hyperlink to control when opening a new window Its properties

The above is the detailed content of How to set the default selection for Select option in Html. 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