The code selects an option from a drop-down list by using a query string. The value attribute sets the optionβs value. The required attribute tells the browser that this select box is required, and the option attribute sets the optionβs text.
<select required>
<option value="">Select an option</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>