Bird
0
0

Identify the accessibility issue in this HTML snippet:

medium📝 Debug Q6 of 15
Testing Fundamentals - Non-Functional Testing
Identify the accessibility issue in this HTML snippet:
<div onclick='submitForm()'>Submit</div>
AThe div should be an image
BThe div has no text content
CThe div is not keyboard accessible
DThe onclick attribute is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Check element role and accessibility

    A div with onclick is clickable but not focusable by keyboard by default, causing accessibility issues.
  2. Step 2: Evaluate other options

    The div has text content, onclick is valid, and it should not be an image for a button.
  3. Final Answer:

    The div is not keyboard accessible -> Option C
  4. Quick Check:

    Clickable div without keyboard focus = accessibility issue [OK]
Quick Trick: Use buttons or add tabindex for keyboard accessibility [OK]
Common Mistakes:
  • Using div for clickable without keyboard support
  • Ignoring keyboard navigation needs
  • Thinking onclick attribute is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Testing Fundamentals Quizzes