Cheap VPS host selection
Provide server host evaluation information

Introduction to setting the default value of the Select tag

In HTML <select> Label, you can use selected Property to set the default value for the option list. take selected Attributes can be added to the required options.

For example:

 < select  name = "mySelect" >
   < option  value = "option1" > Option 1 </ option >
   < option  value = "option2"  selected > Option 2 </ option >
   < option  value = "option3" > Option 3 </ option >
 </ select >

In the above example, the second option (value is "option2") is defined as the default option because it has selected Property. This means that when the user opens the drop-down menu, the option will first be displayed as selected.

If no option is defined selected Property, the first option is selected by default.

Do not reprint without permission: Cheap VPS evaluation » Introduction to setting the default value of the Select tag