HTML Basic
HTML select option drop-down menu
HTML select option is a drop-down menu, usually used in the form ( HTML Form ), you can set options (option), each option gives a different value, for example, let netizens choose age, city of residence, purchase style, etc. Common applications.
HTML select option drop-down menu example
<form>
<select name="YourLocation">
<option value="Taipei">Taipei</option>
<option value="Taoyuan">Taoyuan</option>
<option value="Hsinchu">Hsinchu</option>
<option value="Miaoli">Miaoli</option>
...
</select>
</form>
The results are presented as<select name="YourLocation">
<option value="Taipei">Taipei</option>
<option value="Taoyuan">Taoyuan</option>
<option value="Hsinchu">Hsinchu</option>
<option value="Miaoli">Miaoli</option>
...
</select>
</form>
In this example, <select name="YourLocation"> is the beginning of the drop-down menu, and </select> is the end, where name is the name of the drop-down menu, you can set it yourself, it is recommended to use English letters as the menu Name, each <option></option> tag enclosed in it is an option, and each option has a unique value (value), which is used to determine the item selected by the netizen. The value part is for the program to read , It will not be displayed on the page, it is recommended to use English letters, and the text in <option></option> is the content for netizens to see. You can use Chinese or symbols. A simple select option drop-down menu is roughly completed .
HTML select option drop-down menu can not only be placed in the form, but also can be used directly in the web page, and then create some special effects through JavaScript events. For example, some people use onchange as a page jump menu. Go to a new page without pressing the submit button.
Post a Comment
0 Comments