0
0
Bootsrapmarkup~20 mins

Select menus in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Select Menu Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What is the visual output of this Bootstrap select menu?
Look at the following Bootstrap select menu code. What will you see rendered in the browser?
Bootsrap
<select class="form-select" aria-label="Fruit selection">
  <option selected>Choose a fruit</option>
  <option value="1">Apple</option>
  <option value="2">Banana</option>
  <option value="3">Cherry</option>
</select>
AA button group with three buttons labeled Apple, Banana, Cherry and no default selection.
BA list of radio buttons labeled Apple, Banana, Cherry with 'Choose a fruit' as a heading.
CA text input box with placeholder 'Choose a fruit' and suggestions Apple, Banana, Cherry.
DA dropdown menu with the label 'Choose a fruit' shown as the default selected option, and options Apple, Banana, Cherry available.
Attempts:
2 left
💡 Hint
Remember, element with class 'form-select' renders a dropdown menu. The first
accessibility
intermediate
2:00remaining
Which attribute improves accessibility for this select menu?
You have this select menu code. Which attribute should you add or keep to help screen readers understand it?
Bootsrap
<select class="form-select">
  <option value="1">Red</option>
  <option value="2">Green</option>
  <option value="3">Blue</option>
</select>
AAdd aria-label="Color selection" to the <select> element.
BAdd tabindex="-1" to the <select> element.
CAdd role="button" to the <select> element.
DAdd disabled="true" to the <select> element.
Attempts:
2 left
💡 Hint
Screen readers need a label to describe the purpose of form controls.
📝 Syntax
advanced
2:00remaining
What error occurs with this select menu code?
Examine this Bootstrap select menu code. What error or problem will happen when you try to use it?
Bootsrap
<select class="form-select" multiple>
  <option value="a">Option A</option>
  <option value="b">Option B</option>
  <option value="c">Option C</option>
</select>
ASyntaxError because 'multiple' attribute requires a value like multiple="true".
BNo error; it renders a multiple select menu allowing multiple options to be chosen.
CThe select menu will only allow one option to be selected despite 'multiple' attribute.
DBootstrap will ignore the 'multiple' attribute and render a normal dropdown.
Attempts:
2 left
💡 Hint
In HTML, boolean attributes like 'multiple' do not need a value.