Challenge - 5 Problems
Select Dropdown Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visible output of this select dropdown?
Look at the HTML code below. What will the user see in the dropdown menu when they click it?
HTML
<label for="fruits">Choose a fruit:</label> <select id="fruits" name="fruits"> <option value="apple">Apple</option> <option value="banana" selected>Banana</option> <option value="cherry">Cherry</option> </select>
Attempts:
2 left
💡 Hint
Look for the 'selected' attribute inside the option tags.
✗ Incorrect
The 'selected' attribute on the Banana option means Banana is the default visible choice in the dropdown.
📝 Syntax
intermediate2:00remaining
Which option causes a syntax error in this select dropdown?
Identify which select dropdown code snippet will cause a syntax error in HTML.
Attempts:
2 left
💡 Hint
Check if all option tags are properly closed.
✗ Incorrect
Option C is missing the closing tag for the first option, causing invalid HTML syntax.
❓ accessibility
advanced2:00remaining
Which select dropdown is most accessible for screen readers?
Choose the select dropdown code that best supports screen reader users.
Attempts:
2 left
💡 Hint
Labels help screen readers understand form controls.
✗ Incorrect
Option D uses a
❓ layout
advanced2:00remaining
How to make a select dropdown fill the full width of its container?
Given a select dropdown inside a container, which CSS rule makes the dropdown stretch to fill the container's width?
HTML
<div class="container"> <select> <option>Option 1</option> <option>Option 2</option> </select> </div>
Attempts:
2 left
💡 Hint
Think about how to make an element take all available horizontal space.
✗ Incorrect
Setting width to 100% makes the select fill the container's full width.
🧠 Conceptual
expert2:00remaining
What is the value of the select element after this user interaction?
Consider this HTML and JavaScript. The user selects the third option. What is the value of the select element after the change?
HTML
<select id="mySelect"> <option value="a">Alpha</option> <option value="b">Beta</option> <option value="c">Gamma</option> </select> <script> const select = document.getElementById('mySelect'); select.value = 'b'; select.value = 'c'; </script>
Attempts:
2 left
💡 Hint
The last assignment to select.value sets the final value.
✗ Incorrect
The select.value is set first to 'b', then immediately to 'c', so the final value is 'c'.