Skip to content
Learn Netverks

Lesson

Step 51/58 88% through track

web-apis

HTML and Web APIs

Last reviewed Jun 1, 2026 Content v20260601
Track mode
iframe_html
Means
HTML preview sandbox
Reading
~2 min
Level
advanced

This lesson

This lesson teaches HTML and Web APIs—the ideas, syntax, and habits you need before moving on in HTML.

Without a solid grasp of HTML and Web APIs, you will repeat mistakes in HTML exercises and on real pages or scripts.

You will apply HTML and Web APIs in contexts like: Websites, hybrid apps, email templates, design systems, and CMS-driven content.

Read the lesson, edit HTML/CSS in the playground, press Run to preview, then answer the lesson MCQs. Also use the HTML reference desk when you need tag or attribute lookup.

When intermediate lessons feel comfortable and you are ready for production-style trade-offs.

HTML defines structural hooks; Web APIs extend the browser with programmable capabilities—storage, networking, rendering, sensors, cryptography hooks, and more.

Relationship to markup

  • Elements like canvas, video, or form controls expose DOM interfaces consumed by JavaScript.
  • Security contexts (HTTPS, permissions policies) gate sensitive APIs.

Examples (non-exhaustive)

  • Fetch / XMLHttpRequest for HTTP.
  • WebSockets / WebRTC for realtime communication.
  • IndexedDB / Cache Storage for structured offline data.
  • Intersection Observer for lazy behaviors.

Continue on the JavaScript track for execution patterns—here you learn how markup enables those APIs.

Progressive enhancement

Detect API availability before calling; degrade gracefully when browsers lack features.

Fence-sitting that fails audits

  • Feature detecting then quietly no-oping without user messaging—users think the app is broken.
  • Permissions Policies / Feature Policy misconfiguration blocking camera/mic/geo in iframes unexpectedly—test embed contexts.

HTML is the contract with the platform

Even when logic lives in WASM or workers, declarative markup lists focusable surfaces, exposes names to OS automation, and enables reader mode parsers—cheap to break, expensive to reclaim trust.

API ↔ markup map (examples)

MarkupTypical APIs
canvas, videoCanvasRenderingContext2D, HTMLMediaElement
form, inputFormData, constraint validation, requestSubmit
dialog, detailsHTMLDialogElement, disclosure events
Global navigator, windowStorage, clipboard, permissions, workers

Feature detection pattern

if (!('IntersectionObserver' in window)) {
  // load polyfill or simplified path
}

Rendered output (HTML hooks APIs attach to)

canvas, form, and media elements are declarative hooks; JavaScript APIs add behavior after feature checks.

Important interview questions and answers

  1. Q: What does progressive enhancement mean in API-driven pages?
    A: Core tasks should work with baseline HTML first, then richer APIs enhance experience when supported.
  2. Q: Why is feature detection better than browser sniffing?
    A: It checks actual capability, avoids brittle UA assumptions, and degrades gracefully.
  3. Q: What is the first accessibility check before shipping any page?
    A: Verify keyboard-only task completion with visible focus and meaningful accessible names.

Next: APIs need JavaScript—continue on the JavaScript track.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Community stories on this track

Learner essays linked to HTML — not official lesson content.

Browse all stories

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What confused you about this lesson?
  • How would you explain this to a teammate in 30 seconds?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump