Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14

Chapter 4 quiz

10 questions · instant feedback after each answer.

1.

Which statement best describes HTML5?

Correct answer: B. HTML5 is a complete platform: HTML5 markup + CSS3 + JavaScript APIs such as Canvas, Storage and Geolocation.
2.

Which is the correct doctype declaration for HTML5?

Correct answer: B. HTML5 simplified the doctype to <!DOCTYPE html> — easy to memorise and version-independent.
3.

Which element adds subtitles or captions to video and audio?

Correct answer: C. <track> adds timed text tracks (subtitles, captions, chapters) to <video> and <audio>.
4.

Canvas is raster-based. What is SVG?

Correct answer: B. SVG is vector-based (coordinate-based), so it stays crisp at any size. Canvas is raster and blurs when scaled.
5.

Which element provides a list of predefined suggestions for an input?

Correct answer: B. <datalist> works like an autocomplete suggestion box for an <input> via the list attribute.
6.

Which web storage is cleared when the tab or window closes?

Correct answer: B. sessionStorage is session-scoped — each tab has its own storage, cleared when the tab closes.
7.

Which API runs JavaScript in a background thread so the UI does not freeze?

Correct answer: B. Web Workers run CPU-intensive work in background threads and communicate via postMessage().
8.

How does localStorage differ from cookies?

Correct answer: B. localStorage (~5 MB+) stays in the browser and is never sent with requests; cookies (~4 KB) are sent every request.
9.

Which API accesses the user's physical location?

Correct answer: A. The Geolocation API (navigator.geolocation) requires explicit user permission and HTTPS.
10.

Which element creates a native disclosure widget (hidden until toggled)?

Correct answer: B. <details> with a <summary> label creates a native disclosure widget that expands when clicked.