02 / 04

How would you build a resilient HTML page with no JS?

Building Resilient HTML Without JavaScript

A resilient HTML page should remain usable and accessible even if JavaScript is disabled or fails to load. This ensures that users on low-resource devices, strict networks, or with assistive technologies can still access the core functionality.

Principles for Resilient HTML
  1. 1

    Structure with semantic HTML: Use proper elements (<header>, <main>, <form>, <button>, <a>) so content makes sense without scripts.

  2. 2

    Use native form behavior: Forms should submit and validate at least on the server side, without relying solely on JavaScript.

  3. 3

    Provide navigation with links: Ensure <a> elements handle navigation instead of relying only on client-side routing.

  4. 4

    Ensure accessibility: Use ARIA roles and attributes only when necessary, and let HTML defaults provide meaning.

  5. 5

    Style with CSS only: Avoid depending on JS for layout, show/hide, or basic interactivity that CSS can handle.

Example: Login Page Without JavaScript

In short: By focusing on semantic HTML, server-side validation, and CSS for presentation, you can create a web page that functions fully without JavaScript, while still being enhanced if JavaScript is available.