Complete the code to create a basic select menu with Bootstrap styling.
<select class="form-select" aria-label="Default select example"> <option selected>[1]</option> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> </select>
The option with the selected attribute shows the default text in the select menu. "Choose an option" is a clear prompt for users.
Complete the code to add a label for the select menu for accessibility.
<label for="fruitSelect" class="form-label">[1]</label> <select class="form-select" id="fruitSelect" aria-label="Fruit select"> <option selected>Choose a fruit</option> <option value="apple">Apple</option> <option value="banana">Banana</option> <option value="cherry">Cherry</option> </select>
The label text should clearly describe what the select menu is for. "Select your fruit" is a clear instruction for users and screen readers.
Fix the error in the select menu code by completing the missing attribute.
<select class="form-select" [1] aria-label="Country select"> <option selected>Choose a country</option> <option value="us">United States</option> <option value="ca">Canada</option> <option value="mx">Mexico</option> </select>
name instead of id for label linkingdisabled which prevents selectionThe id attribute is needed to link the select menu with its label or for scripting. Without it, accessibility and form behavior can be affected.
Fill both blanks to create a multiple select menu with Bootstrap styling and proper accessibility.
<label for="[1]" class="form-label">Select your hobbies</label> <select class="form-select" id="[2]" multiple aria-label="Hobbies select"> <option value="reading">Reading</option> <option value="sports">Sports</option> <option value="music">Music</option> <option value="travel">Travel</option> </select>
The label and the select must share the same id value for accessibility. "hobbySelect" is a clear and consistent id.
Fill all three blanks to create a select menu with a disabled placeholder option and Bootstrap styling.
<select class="form-select" aria-label="[1]"> <option value="" [2] selected>[3]</option> <option value="red">Red</option> <option value="green">Green</option> <option value="blue">Blue</option> </select>
The aria-label describes the select menu for screen readers. The placeholder option is disabled and selected to prompt the user to pick a color.