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

How to set the default selection for Select option in Html

php中世界最好的语言
Release: 2018-02-02 10:16:38
Original
11628 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template