HTML Interview Prep
Explain the difference between decorative and informative image alternatives.
Understand the topic
Prepare to explain decisions rather than recite tag definitions. Useful questions compare semantics, form behavior, accessibility, and resource loading. Answer with a short principle, a concrete example, and a tradeoff where relevant. If you are unsure about browser support or a specialized attribute, explain how you would verify it in documentation and test the target browsers.
Worked example
<details><summary>Why use a button rather than a clickable div?</summary><p>A button provides native focus, keyboard activation, and action semantics.</p></details>
<details><summary>How do id and name differ?</summary><p>id identifies a DOM element; name identifies a submitted form value.</p></details>
<details><summary>Why validate again on the server?</summary><p>Client requests can bypass browser constraints and must be checked by the receiving service.</p></details>
The answers connect markup to behavior. Expand them with examples from your own website project.
Practice
Explain the difference between decorative and informative image alternatives.
Show a suggested answer
Informative images need alternatives expressing their purpose. Pure decorations normally use alt="" so they do not add unnecessary announcements.Common mistake
Do not claim every browser behaves identically. State the behavior you rely on and how you would test it.