0
0
Bootsrapmarkup~20 mins

Input groups in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Input Group Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What will this Bootstrap input group render?
Look at the following Bootstrap input group code. What will you see in the browser?
Bootsrap
<div class="input-group mb-3">
  <span class="input-group-text" id="basic-addon1">@</span>
  <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
</div>
AAn input box with '@' text inside the input box as placeholder.
BA plain input box with '@' text above it.
CAn input box with '@' text on the right side outside the input border.
DAn input box with a grey box containing '@' on the left side inside the input border.
Attempts:
2 left
💡 Hint
Remember that adds a styled box inside the input group.
selector
intermediate
1:30remaining
Which class adds a button inside a Bootstrap input group?
You want to add a clickable button inside a Bootstrap input group. Which class should you use on the button element?
Abtn
Binput-group-text
Cbtn-group
Dinput-group-btn
Attempts:
2 left
💡 Hint
Bootstrap buttons always use the 'btn' class.
🧠 Conceptual
advanced
1:30remaining
What is the purpose of aria-describedby in Bootstrap input groups?
In Bootstrap input groups, the input often has an attribute like aria-describedby="basic-addon1". What does this attribute do?
AIt links the input to a descriptive element for screen readers, improving accessibility.
BIt styles the input border color when focused.
CIt makes the input required before form submission.
DIt disables the input field.
Attempts:
2 left
💡 Hint
Think about how screen readers understand form controls.
layout
advanced
2:00remaining
How to place a button on the right side inside a Bootstrap input group?
You want a text input with a button attached on the right side inside the same input group. Which code snippet achieves this?
A
&lt;div class="input-group"&gt;
  &lt;span class="input-group-text"&gt;Go&lt;/span&gt;
  &lt;input type="text" class="form-control"&gt;
&lt;/div&gt;
B
&lt;div class="input-group"&gt;
  &lt;button class="btn btn-primary" type="button"&gt;Go&lt;/button&gt;
  &lt;input type="text" class="form-control"&gt;
&lt;/div&gt;
C
&lt;div class="input-group"&gt;
  &lt;input type="text" class="form-control"&gt;
  &lt;button class="btn btn-primary" type="button"&gt;Go&lt;/button&gt;
&lt;/div&gt;
D
&lt;div class="input-group"&gt;
  &lt;input type="text" class="form-control"&gt;
  &lt;span class="input-group-text"&gt;Go&lt;/span&gt;
&lt;/div&gt;
Attempts:
2 left
💡 Hint
The order of elements inside input-group determines their position.
accessibility
expert
2:30remaining
Which attribute is essential for screen reader users to understand input groups with multiple addons?
When an input group has multiple addons (like prefix and suffix text), which attribute should be used on the input to ensure screen readers read all descriptions correctly?
Aaria-labelledby with IDs of all addon elements
Baria-describedby with IDs of all addon elements separated by spaces
Caria-label with a combined text description
Daria-hidden on all addon elements
Attempts:
2 left
💡 Hint
aria-describedby can reference multiple elements by listing their IDs separated by spaces.