Lead Frontend
​
​
Log inSign up
React interview questionsJavaScript interview questionsTypeScript interview questionsCSS interview questionsHTML interview questionsSenior frontend interview questionsLead frontend engineer interview questionsQuestions by topicCompany guides
© 2026 Lead Frontend. Free educational content, provided as is; it may contain errors. Not affiliated with any company or product named on this site.
TermsPrivacyDisclaimerCopyrightLicenses & credits

HTML Interview Questions

22 questions with answers

HTML questions are often where interviewers check your accessibility and fundamentals: semantic elements, forms, script loading, metadata and how the browser turns markup into a page. Senior candidates are expected to connect markup choices to accessibility, performance and SEO.

How to prepare

  • Pick the right semantic element and explain what it gives assistive technology.
  • Know the difference between async and defer scripts and how they affect parsing.
  • Build an accessible form: labels, errors, validation and keyboard support.

HTML Interview Questions

1.What is the first rule of ARIA, and what are the most common ARIA mistakes you see in code reviews?

Native first, ARIA changes semantics not behaviour, and the recurring misuse patterns in component libraries.

Quiz · HTML
Medium
8 min

2.How does the native <dialog> element work, and what does showModal() give you over a custom modal?

Top layer, inertness, focus handling, Escape, ::backdrop, form method=dialog and remaining gaps.

Quiz · HTML
Medium
8 min

3.Why does semantic HTML matter, and how do landmark elements help assistive technology users?

Implicit roles, landmark navigation, headings, buttons vs links, and the cost of div soup.

Quiz · HTML
Easy
7 min

4.HTML Serializer

Turn a plain-object element tree into pretty-printed, correctly escaped HTML with indentation and void elements.

JS Functions
Easy
20 min

5.How do ARIA live regions work, and how do you announce dynamic updates reliably?

polite vs assertive, status and alert roles, aria-atomic, timing pitfalls and an announcer pattern.

Quiz · HTML
Medium
7 min

6.Consider HTML5 as an open web platform. What are the building blocks of HTML5?

- Semantics - Allowing you to describe more precisely what your content is.

Quiz · HTML
Medium
3 min

7.Describe the difference between a cookie, sessionStorage and localStorage.

All the above-mentioned technologies are key-value storage mechanisms on the client side. They are only able to store values as strings.

Quiz · HTML
Medium
3 min

8.Describe the difference between <script>, <script async> and <script defer>.

- <script - HTML parsing is blocked, the script is fetched and executed immediately, HTML parsing resumes after the script is executed.

Quiz · HTML
Medium
3 min

9.How do browsers prioritise resource loading, and when should you use the fetchpriority attribute?

Default priorities by resource type, fetchpriority high/low/auto, interaction with lazy loading and preload.

Quiz · HTML
Medium
7 min

10.Have you used different HTML templating languages before?

Yes, Pug (formerly Jade), ERB, Slim, Handlebars, Jinja, Liquid, and EJS just to name a few. In my opinion, they are more or less the same and provide similar fu

Quiz · HTML
Medium
3 min

11.How do you serve a page with content in multiple languages?

I will assume that it is asking about the most common case, which is how to serve a page with content available in multiple languages, but the content within th

Quiz · HTML
Medium
3 min

12.What does the inert attribute do, and when would you use it instead of aria-hidden or tabindex=-1?

Removing subtrees from focus, interaction and the accessibility tree in one attribute, with real use cases.

Quiz · HTML
Medium
6 min

13.What is the Popover API, and when do you use popover instead of a <dialog> or a custom dropdown?

popover=auto/manual, popovertarget, light dismiss, top layer, anchor positioning and accessibility gaps.

Quiz · HTML
Medium
7 min

14.What are data- attributes good for?

Before JavaScript frameworks became popular, front end developers used data- attributes to store extra data within the DOM itself, without other hacks such as n

Quiz · HTML
Medium
3 min

15.What are empty elements in HTML?

Empty elements in HTML are elements that do not contain any content between their opening and closing tags. Instead, they are self-closing tags, meaning they ha

Quiz · HTML
Medium
3 min

16.What does a DOCTYPE do?

DOCTYPE is an abbreviation for Document Type. A DOCTYPE is always associated to a DTD - for Document Type Definition.

Quiz · HTML
Medium
3 min

17.What is progressive rendering?

Progressive rendering is the name given to techniques used to improve the performance of a webpage (in particular, improve perceived load time) to render conten

Quiz · HTML
Medium
3 min

18.What is the difference between canvas and SVG?

Canvas is raster-based, working with pixels, while SVG is vector-based, employing mathematical descriptions of shapes. Canvas employs imperative drawing, where

Quiz · HTML
Medium
3 min

19.What kind of things must you be wary of when designing or developing for multilingual sites?

- Use lang attribute in your HTML.

Quiz · HTML
Medium
3 min

20.Why is it generally a good idea to position CSS <link>s between <head></head> and JS <script>s just before </body>? Do you know any exceptions?

Putting <links in the <head is part of proper specification in building an optimized website. When a page first loads, HTML and CSS are being parsed simultaneou

Quiz · HTML
Medium
4 min

21.Why you would use a srcset attribute in an image tag? Explain the process the browser uses when evaluating the content of this attribute.

You would use the srcset attribute when you want to serve different images to users depending on their device display width - serve higher quality images to dev

Quiz · HTML
Medium
3 min

22.How do you detect if JavaScript is disabled on a page?

noscript, the no-js class swap, the scripting media feature, and progressive enhancement.

Quiz · Web & Browser
Medium
4 min

More interview questions

React Interview QuestionsJavaScript Interview QuestionsTypeScript Interview QuestionsCSS Interview QuestionsSenior Frontend Interview QuestionsLead Frontend Engineer Interview QuestionsQuestions by topic