Challenge - 5 Problems
Multi-target Collapse Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
How does multi-target collapse work in Bootstrap?
In Bootstrap, when you use a button to toggle multiple collapse targets at once, what happens when the button is clicked?
Attempts:
2 left
💡 Hint
Think about what happens when multiple IDs are listed in the data-bs-target attribute.
✗ Incorrect
When a button targets multiple collapse elements using a selector list, Bootstrap toggles each targeted element's visibility at the same time.
📝 Syntax
intermediate2:00remaining
Identify the correct syntax for multi-target collapse button
Which of the following button elements correctly toggles two collapse elements with IDs
#panel1 and #panel2 simultaneously?Attempts:
2 left
💡 Hint
Remember the correct attribute names and how to separate multiple selectors.
✗ Incorrect
Bootstrap uses data-bs-toggle and data-bs-target attributes. Multiple targets are separated by a comma and space.
❓ rendering
advanced2:00remaining
What is the visual result of this multi-target collapse code?
Given the following HTML snippet, what will the user see after clicking the button once?
<button class="btn btn-secondary" data-bs-toggle="collapse" data-bs-target="#box1, #box2">Toggle Boxes</button> <div id="box1" class="collapse show">Box 1 Content</div> <div id="box2" class="collapse">Box 2 Content</div>
Attempts:
2 left
💡 Hint
Check the initial visibility states and what toggling does to each.
✗ Incorrect
Box 1 starts visible (show class), Box 2 hidden. Clicking toggles both: Box 1 hides, Box 2 shows.
❓ selector
advanced2:00remaining
Which CSS selector targets all collapse elements toggled by a multi-target button?
If a button toggles multiple collapse elements with IDs
#panelA and #panelB, which CSS selector correctly selects both panels?Attempts:
2 left
💡 Hint
Think about how to select multiple elements by ID in CSS.
✗ Incorrect
Using a comma separates selectors, so #panelA, #panelB selects both elements.
❓ accessibility
expert2:00remaining
How to ensure accessibility for a multi-target collapse button?
Which ARIA attribute should be used on a button that toggles multiple collapse regions to properly inform screen readers?
Attempts:
2 left
💡 Hint
ARIA attributes help screen readers know which elements the button controls.
✗ Incorrect
The aria-controls attribute should list all IDs of the elements the button toggles, separated by spaces, so assistive tech can identify them.