A. Using data-toggle instead of data-bs-toggle for Bootstrap 5
B. Missing the class dropdown-toggle-split on the toggle button
C. The dropdown-menu should be a div, not ul
D. The main button should have dropdown-toggle class
Solution
Step 1: Check Bootstrap 5 data attribute usage
Bootstrap 5 uses data-bs-toggle instead of data-toggle to activate dropdowns.
Step 2: Identify the incorrect attribute
The code uses data-toggle="dropdown", which is from Bootstrap 4 and will not work in Bootstrap 5.
Final Answer:
Using data-toggle instead of data-bs-toggle for Bootstrap 5 -> Option A
Quick Check:
Bootstrap 5 uses data-bs-toggle [OK]
Hint: Bootstrap 5 uses data-bs-toggle, not data-toggle [OK]
Common Mistakes:
Forgetting to add dropdown-toggle-split class
Using old data-toggle attribute
Changing dropdown-menu from ul to div incorrectly
5. You want a split button dropdown where the main button triggers a form submission and the dropdown offers alternative submission options. Which is the best way to implement this in Bootstrap?
hard
A. Use a <form> with a main button type='submit' and a split dropdown toggle with data-bs-toggle='dropdown'
B. Use two separate buttons outside a form, one for submit and one for dropdown
C. Use a single dropdown button with all submission options inside the dropdown
D. Use a main button with type='button' and dropdown toggle without form
Solution
Step 1: Understand form submission with split button
The main button should submit the form, so it needs type='submit' inside the form element.
Step 2: Add dropdown toggle for alternative options
The dropdown toggle uses data-bs-toggle='dropdown' to show alternative submission choices without submitting immediately.
Final Answer:
Use a <form> with a main button type='submit' and a split dropdown toggle with data-bs-toggle='dropdown' -> Option A
Quick Check:
Main button submits form + dropdown toggle shows options [OK]
Hint: Main button type='submit' inside form + dropdown toggle [OK]
Common Mistakes:
Using type='button' on main submit button
Placing buttons outside the form
Using single dropdown button without main submit
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.