0
0
HTMLmarkup~20 mins

Global attributes in HTML - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Global Attributes Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the purpose of the tabindex global attribute?
Which of the following best describes what the tabindex attribute does when added to an HTML element?
AIt defines the order in which elements receive keyboard focus when pressing the Tab key.
BIt sets the text color of the element.
CIt hides the element from screen readers.
DIt specifies the URL of a linked resource.
Attempts:
2 left
💡 Hint
Think about how keyboard users move through a webpage.
📝 Syntax
intermediate
2:00remaining
Which option correctly uses the aria-label global attribute?
Select the HTML snippet that correctly uses the aria-label attribute to provide an accessible name for a button.
A<button aria-label=''>Close menu</button>
B<button aria-label>Close menu</button>
C<button aria-label="Close menu">X</button>
D<button aria-label=Close menu>X</button>
Attempts:
2 left
💡 Hint
The attribute needs a value inside quotes.
rendering
advanced
2:00remaining
What is the visual effect of adding hidden attribute to an element?
Given this HTML snippet, what will you see in the browser?
HTML
<div>Visible text</div>
<div hidden>Hidden text</div>
ABoth 'Visible text' and 'Hidden text' are visible.
BOnly 'Hidden text' is visible; 'Visible text' is hidden.
C'Hidden text' is visible but grayed out.
DOnly 'Visible text' is shown; 'Hidden text' is not visible or takes space.
Attempts:
2 left
💡 Hint
The hidden attribute hides the element completely.
selector
advanced
2:00remaining
Which CSS selector targets all elements with the global attribute contenteditable set to true?
Choose the correct CSS selector to style all elements where contenteditable is exactly true.
A.contenteditable-true { border: 1px solid blue; }
B[contenteditable="true"] { border: 1px solid blue; }
C[contenteditable] { border: 1px solid blue; }
D#contenteditable=true { border: 1px solid blue; }
Attempts:
2 left
💡 Hint
Attribute selectors use square brackets and quotes for exact matches.
accessibility
expert
2:00remaining
What is the effect of using aria-hidden="true" on an element with visible content?
If an element has visible text but includes aria-hidden="true", what happens for screen reader users?
AScreen readers ignore the element and do not read its content.
BScreen readers read the element normally.
CScreen readers read the element twice.
DScreen readers highlight the element but do not read the text.
Attempts:
2 left
💡 Hint
Think about hiding content from assistive technologies but not visually.