Challenge - 5 Problems
ARIA Accessibility Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding ARIA roles in Angular templates
Which ARIA role should you add to a
Attempts:
2 left
💡 Hint
Think about the semantic purpose of the
✗ Incorrect
📝 Syntax
intermediate2:00remaining
Binding ARIA attributes dynamically in Angular
In Angular, how do you correctly bind the aria-label attribute to a component property named 'labelText' in the template?
Angular
<button _____>Click me</button>
Attempts:
2 left
💡 Hint
Angular uses square brackets for property binding.
✗ Incorrect
To bind an attribute dynamically, use square brackets with the attribute name: [attr.aria-label]. Using interpolation inside quotes works for normal attributes but is not recommended for ARIA attributes.
❓ rendering
advanced2:00remaining
Effect of ARIA attributes on screen reader output
Given this Angular template snippet, what will a screen reader announce when focusing on the button?
Assuming
<button [attr.aria-pressed]="isPressed">Toggle</button>
Assuming
isPressed is true.Attempts:
2 left
💡 Hint
aria-pressed indicates toggle state and is read as 'pressed' or 'not pressed'.
✗ Incorrect
When aria-pressed is true, screen readers announce the button as pressed. This helps users understand the toggle state.
❓ selector
advanced2:00remaining
Selecting elements with ARIA attributes in Angular templates
Which CSS selector correctly targets all elements with an aria-label attribute in an Angular component's styles?
Attempts:
2 left
💡 Hint
Attribute selectors use square brackets in CSS.
✗ Incorrect
The selector [aria-label] matches any element that has an aria-label attribute, regardless of its value.
❓ accessibility
expert3:00remaining
Ensuring keyboard accessibility with ARIA in Angular
You have a custom dropdown component in Angular that uses a div with role="listbox" and div children with role="option". Which ARIA attribute is essential to update dynamically to indicate the currently focused option for keyboard users?
Attempts:
2 left
💡 Hint
This attribute tells assistive technologies which option is chosen or focused.
✗ Incorrect
aria-selected should be set to true on the currently focused or selected option to inform screen readers about the active choice.