B. The input is missing the class form-check-label.
C. The div should have class form-check-input instead of form-check.
D. The label uses id instead of for attribute to link to input.
Solution
Step 1: Check label linkage to input
Labels must use the for attribute matching the input's id for accessibility and clicking.
Step 2: Identify incorrect attribute usage
The label incorrectly uses id='agree' instead of for='agree'.
Final Answer:
The label uses id instead of for attribute to link to input. -> Option D
Quick Check:
Label uses for, not id, to link input [OK]
Hint: Label must use for attribute matching input id [OK]
Common Mistakes:
Using id on label instead of for
Missing form-check-input class on input
Confusing input types checkbox vs radio
5. You want to create a group of checkboxes in Bootstrap where users can select multiple fruits. Which code snippet correctly implements this with accessible labels and Bootstrap styling?
hard
A.
\n \n Apple\n
\n
\n \n Banana\n
B.
\n \n Apple\n
\n
\n \n Banana\n
C.
\n \n Apple\n
\n
\n \n Banana\n
D.
\n \n Apple\n
\n
\n \n Banana\n
Solution
Step 1: Confirm input types for multiple selection
Checkboxes allow multiple selections, so input type must be checkbox.
Step 2: Check label and input classes and attributes
Inputs must have class form-check-input, labels must have form-check-label, and labels must use for matching input id.
Step 3: Verify unique ids and consistent names
Each checkbox has a unique id and the same name attribute to group them logically.
Final Answer:
Option A correctly uses checkboxes with proper classes, unique ids, and accessible labels. -> Option A
Quick Check:
Checkboxes + form-check-input + matching for/id =
\n \n Apple\n\n
\n \n Banana\n
[OK]
Hint: Use checkbox type and matching for/id for labels [OK]
Common Mistakes:
Using radio buttons instead of checkboxes for multiple choices
Repeating ids for different inputs
Swapping input and label classes
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.