Complete the code to create a dropdown menu with options.
<select>[1]</select><div> or <input> inside <select>.<option> tags.The <option> tag defines an option in a dropdown menu inside a <select> element.
Complete the code to set a default selected option in the dropdown.
<select>
<option>Apple</option>
<option [1]>Banana</option>
<option>Cherry</option>
</select>checked instead of selected.default or active.The selected attribute marks an option as the default selected in a dropdown.
Fix the error in the dropdown code by filling the blank.
<select> <option value="1">One</option> <option value="2" [1]>Two</option> <option value="3">Three</option> </select>
checked which is for checkboxes.select which is not a valid attribute.The correct attribute to mark an option as selected is selected. Other options cause errors or have no effect.
Fill both blanks to create a dropdown with a label and a disabled option.
<label for="fruits">Choose a fruit:</label> <select id="fruits" name="fruits"> <option [1]>Select one</option> <option value="apple">Apple</option> <option value="banana" [2]>Banana</option> </select>
readonly or checked which are invalid here.The first option is disabled to prevent selection, and the second option is selected by default.
Fill all three blanks to create a dropdown with multiple options, a label, and a required attribute.
<label for="colors">Pick a color:</label> <select id="colors" name="colors" [1]> <option value="red">Red</option> <option value="green" [2]>Green</option> <option value="blue" [3]>Blue</option> </select>
multiple with required.The required attribute makes the dropdown mandatory to select. The green option is selected by default, and the blue option is disabled.