HTML5 Features

Q31 — New HTML5 features?

Semantic tags, audio/video, canvas, SVG, geolocation, web storage, Web Workers, offline APIs, new input types, picture/srcset for responsive images.

Q32 — <audio> and <video> usage?

Native media elements with controls, autoplay, loop, muted, multiple sources.

<video controls>
  <source src="movie.mp4" type="video/mp4">
  Your browser does not support video.
</video>

Q33 — <canvas> vs <svg>?

Canvas: pixel-based, procedural drawing (games, animations).

SVG: vector-based, DOM elements (icons, charts, diagrams).

Q35 — Local Storage vs Session Storage?

Both store key-value data in browser.

localStorage: persists across tabs and restarts.

sessionStorage: cleared when tab closes.

Q36 — Cookies vs localStorage vs sessionStorage?

Cookies: tiny, sent to server, can expire, secure flags.

localStorage: large, persistent, client-side only.

sessionStorage: temporary per tab.

Q37 — data-* vs id/class?

data-*: custom data for JS.

id: unique identifier.

class: reusable group for styling/JS.

Q38 — Web Workers?

Run JS in the background for CPU-heavy tasks without blocking UI.

Q39 — Application Cache vs Service Workers?

AppCache: Deprecated.

Service Workers: modern offline cache, request control, background sync.

Q40 — Geolocation vs Device Orientation API?

Geolocation: latitude/longitude position.

Device Orientation: access accelerometer/gyro for device tilt & rotation.

⬅ Home