OnlineCBT Logo OnlineCBT
HTML Tutorial
HTML · LESSON 72

HTML Interview Questions

By Ratan Updated: 16 Oct 2026

Prepare for technical web development job interviews with top HTML questions and answers.

Level: Beginner to Advanced
Duration: ~60 Mins Deep-Dive

1. Top HTML Interview Questions & Answers

Q1: What is the difference between HTML elements and HTML tags?

Answer: An HTML tag is the syntax keyword enclosed in brackets (e.g.

and

). An HTML element encompasses the starting tag, any attributes, the inner text or child nodes, and the closing tag.

Q2: What is Quirks Mode and how do you avoid it?

Answer: If a document lacks the preamble, browsers render pages in Quirks Mode to support legacy 1990s web pages, resulting in broken modern CSS layouts. Specifying forces modern Standards Mode.

Q3: What are the differences between sessionStorage, localStorage, and cookies?

Answer: Cookies store up to 4KB and are sent with every HTTP request. LocalStorage stores up to 5-10MB and persists permanently on the client. SessionStorage stores data for the duration of the browser tab session only.

Q4: What is the difference between async and defer in script loading?

Answer: Both download scripts asynchronously without blocking HTML parsing. async executes as soon as the script downloads (potentially before DOM parsing finishes and in non-deterministic order). defer executes in exact document order only after HTML parsing is completely done.

📝 Live Lesson Practice

HTML/CSS JavaScript Python C++ C PHP
⌨️ Practice Inputs (लाइव इनपुट भरें) (खाली होने पर RED, भरने पर GREEN underline)
💻 Code Editor (Monaco VS Code Engine)
👀 Live Preview
पता संपर्क करें

+91 7877547686

ई-मेल

onlinecbtportal@gmail.com

हेल्पलाइन नंबर

+91 7877547686


डाउनलोड करने के लिए क्लिक करें
Get it on Google Play

ऐप डाउनलोड करने
के लिए Google Play पर
उपलब्ध है

WhatsApp Chat