Create drop down list in HTML
Question:
How to create drop down list in HTML? Answer:
<select name="day">
<option value="mon">Monday</option>
<option value="tue">Tuesday</option>
<option value="wed" selected>Wednesday</option>
<option value="thu">Thursday</option>
<option value="fri">Friday</option>
<option value="sat">Saturday</option>
<option value="sun">Sunday</option>
</select>
Description:
The HTML <select>
element represents a control that provides a list of options in a form of a drop-down list.
Each <option>
element should have a value attribute containing the data value to submit to the server when that option is selected. If no value attribute is included, the value defaults to the text contained inside the element. You can include a selected
attribute on an <option>
element to make it selected by default when the page first loads.
Reference:
The select element reference
Share "How to create drop down list in HTML?"
Related snippets:
Tags:
html drop-down, drop-down list, html, drop down, list Technical term:
Create drop down list in HTML