Html Select uses the selected attribute to set the default selection

不言
Release: 2018-05-08 14:51:16
Original
4116 people have browsed it

This article mainly introduces how to use the selected attribute to set the default selection in Html Select. It has certain reference value. Now I share it with you. Friends in need can refer to it.

How to make the default selection in Html Select , as long as you add the selected = "selected" attribute to an option, it will be the default option. The following is an example. I hope it will be helpful to everyone.

Adding the selected = "selected" attribute to an option will be the default option.
For example :

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

Then "Pass" is selected by default ##.

#

The above is the detailed content of Html Select uses the selected attribute to set the default selection. 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