1. Drop-down radio selection
<select> <option value="=1">上海</option> <option value="=2" selected="selected">北京</option> <option value="=3">广州</option> </select>
2. Show all options
There are two types here. You can only choose one option. Multiple selection
<select size="3"> <option>上海</option> <option>广州</option> <option>深圳</option> </select> <select multiple="multiple" size="3"> <option>上海</option> <option>广州</option> <option>深圳</option> </select>
3. Element classification
<select> <optgroup label="河北省"> <option>石家庄</option> <option>邯郸</option> <option>枣阳</option> </optgroup> <optgroup label="湖北省"> <option>武汉</option> <option>咸宁</option> <option>赤壁</option> </optgroup> <optgroup label="河南省"> <option>郑州</option> <option>安阳</option> <option>驻马店</option> </optgroup> </select>
The above is the detailed content of How to use the select tag in html. For more information, please follow other related articles on the PHP Chinese website!