Native elements come with behavior as well as semantics: a button is focusable, fires on Enter and Space, participates in forms and exposes the right role and state for free. A div with role button gets the label but none of the behavior, so you add tabindex, key handling and disabled state yourself, and each one can go wrong. The first rule of ARIA is not to use ARIA when HTML already does the job.
Why interviewers ask this
Accessibility questions separate people who ran an automated audit once from people who actually build usable components. The interviewer wants to hear that ARIA changes what is announced but never adds keyboard behavior or focus management. Naming a real case, such as a fake button that cannot be reached by keyboard, proves you have tested with a keyboard or a screen reader rather than trusting a green Lighthouse score.
How to structure your answer
- State the split: native gives semantics plus behavior, ARIA only relabels.
- List what you have to re implement when you use a div.
- Quote the rule about not using ARIA when HTML exists.
- Give an example where a native element saved real work.
Example answer
ARIA only changes what gets exposed to the accessibility tree. It does not make anything focusable, it does not add key handling, and it does not manage focus. So the moment I write a div with role button I have signed up for tabindex zero, an Enter and Space handler, an aria disabled state that I also have to enforce in the handler, and I still do not get form submission. A real button gives me all of that and it stays correct when the browser changes. So my default is native first: button, a with a real href, input with a matching label, dialog for modals, details for simple disclosure. I reach for ARIA when there is genuinely no native equivalent, like a tab set or a combobox, and then I follow the authoring practices pattern rather than improvising roles. The bug I see most often is a clickable div in a table row that a keyboard user simply cannot reach, and it passes every automated check because nothing in the markup is technically wrong.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you make a custom tab component keyboard accessible?
- What does aria hidden do, and when does it cause harm?
- How do you test this beyond running an automated scanner?
Related frontend developer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions