In the previous articles of this series, I’ve challenged several prevailing trends in web development—from JavaScript-heavy SPAs to utility-first CSS frameworks. Now, I want to focus on a principle that has been with us since the early days of web development but has been largely forgotten in the modern era: progressive enhancement.
What Is Progressive Enhancement?
At its core, progressive enhancement is a design philosophy that puts content first and builds additional layers of functionality and sophistication on top of a solid foundation. It follows a simple pattern:
- Start with semantic HTML that works without CSS or JavaScript
- Add CSS to enhance the visual experience
- Add JavaScript to enhance behaviour and interactivity
The key insight is that if any layer fails (JavaScript errors, CSS not loading, etc.), the application continues to function at a more basic level. This creates inherent resilience in your applications.
Progressive enhancement isn’t about building outdated or simplistic interfaces. It’s about building sophisticated experiences that don’t collapse when things go wrong.
Why Progressive Enhancement Still Matters
Modern web development often takes the opposite approach—starting with a JavaScript framework and treating HTML as an afterthought (or something that’s generated by JavaScript). This approach, sometimes called “graceful degradation,” has several critical flaws:
-
Single point of failure: If JavaScript fails to load or execute properly, nothing works
-
Performance penalties: Users often see nothing until the JavaScript bundle has downloaded, parsed, and executed
-
Accessibility issues: Screen readers and assistive technologies often struggle with JavaScript-generated content
-
SEO challenges: Despite improvements in crawler JavaScript support, static HTML remains more reliably indexed
These aren’t theoretical problems. Studies consistently show that JavaScript errors in production are common. Mobile networks are unreliable. Browsers are diverse. Users have varying hardware capabilities. Progressive enhancement acknowledges and accommodates these realities.
Progressive Enhancement in Practice
Let’s consider a concrete example: a search form with autocomplete suggestions.
The Base Layer: HTML
We start with standard HTML that functions without any JavaScript:
<form action="/search" method="get">
<label for="search">Search:</label>
<input type="search" id="search" name="q">
<button type="submit">Search</button>
</form>
This form works everywhere. It performs a GET request to /search with the
query parameter, and the server returns results. It’s accessible, indexable, and
reliable.
The Enhancement Layer: JavaScript
Now we can enhance this with HTMX and/or AlpineJS to add autocomplete functionality:
<form action="/search" method="get">
<label for="search">Search:</label>
<input
type="search"
id="search"
name="q"
hx-get="/api/suggestions"
hx-trigger="keyup delay:500ms"
hx-target="#suggestions"
x-data="{ query: '' }"
x-model="query"
>
<button type="submit">Search</button>
<div id="suggestions"></div>
</form>
With HTMX, each keypress now triggers a request to /api/suggestions after a
500ms delay, and the response updates the suggestions div. AlpineJS provides
additional client-side reactivity.
If HTMX fails to load or the /api/suggestions endpoint is down, the form still
works. Users can still search. They just won’t get autocomplete.
Taking It Further: Adding Graceful Enhancements
We can continue adding layers of enhancement that fall back gracefully:
<form action="/search" method="get" hx-boost="true">
<label for="search">Search:</label>
<input
type="search"
id="search"
name="q"
hx-get="/api/suggestions"
hx-trigger="keyup delay:500ms"
hx-target="#suggestions"
x-data="{ query: '' }"
x-model="query"
hx-indicator=".spinner"
>
<button type="submit">Search</button>
<div class="spinner" style="display:none;">Loading...</div>
<div id="suggestions"></div>
</form>
Now, with hx-boost="true", even the form submission is enhanced to load
results without a full page refresh. But again, if HTMX isn’t available, the
form reverts to standard behaviour.
HTTP and HTML Primitives as the Foundation
The web platform provides powerful primitives that often get overlooked in the quest for novelty:
Forms and Form Controls
HTML forms are a complete solution for gathering user input. They provide:
- Built-in validation
- Accessibility features
- Keyboard navigation
- Mobile-friendly input types
- Native browser features like autofill
Before reaching for a complex form library, consider whether HTML’s native
<form>, <input>, <select>, and other controls might be sufficient, perhaps
with light JavaScript enhancements.
Link Navigation
The humble <a> element remains one of the web’s most powerful features. It
provides:
- Browser history management
- Right-click context menu options
- Middle-click to open in new tab
- Keyboard navigation
- Accessibility
Libraries like HTMX extend these primitives rather than replacing them, adding dynamic behaviour whilst preserving their inherent benefits.
HTTP Methods
HTML forms natively support GET and POST, but modern web APIs use the full range of HTTP methods (PUT, DELETE, PATCH, etc.). HTMX bridges this gap by allowing any HTML element to trigger any HTTP method:
<button hx-delete="/items/1" hx-target="#items-list">
Delete Item
</button>
This maintains the connection to HTTP’s request/response pattern whilst adding interaction without full page reloads.
The Role of Modern JavaScript Libraries
I’m not suggesting we abandon JavaScript entirely. Libraries like AlpineJS and HTMX can enhance the user experience significantly. The key difference from monolithic frameworks is their approach:
AlpineJS: Minimal But Powerful
AlpineJS provides reactive data binding and declarative templates directly in HTML:
<div x-data="{ open: false }">
<button @click="open = !open">Toggle</button>
<div x-show="open">Content</div>
</div>
This adds interactivity without departing from HTML’s declarative nature. And if AlpineJS fails to load, the content remains visible—it just won’t toggle.
HTMX: Extending HTML for AJAX
As demonstrated earlier, HTMX adds dynamic behaviour to HTML elements through attributes:
<button hx-post="/api/like" hx-swap="outerHTML">
Like
</button>
This maintains a connection to the server whilst avoiding full page reloads. If
HTMX doesn’t load, the button still submits a form post to /api/like.
Common Objections to Progressive Enhancement
Despite its benefits, progressive enhancement faces resistance. Let’s address some common objections:
“Our users always have JavaScript enabled”
Even if every user has JavaScript enabled, JavaScript can still fail for countless reasons:
- Network errors when loading scripts
- Browser extensions interfering with execution
- Corporate proxies modifying content
- CDN outages
- Parsing errors in your code
- Third-party script conflicts
Progressive enhancement isn’t about supporting JavaScript-disabled browsers—it’s about resilience in the face of inevitable failures.
“It takes too much development time”
Actually, progressive enhancement often saves time in the long run:
- Fewer edge cases to debug
- Reduced complexity in error handling
- Better separation of concerns
- More predictable user experiences
- Fewer support tickets for broken functionality
Starting with HTML forces you to think about core functionality first, leading to clearer product design.
“Modern web apps are too complex for this approach”
This objection conflates complexity with approach. Even complex applications can be built with progressive enhancement principles. Consider GitHub, which uses progressive enhancement extensively despite its complexity.
The truth is that most web applications are essentially forms and data presentation—precisely what HTML was designed to handle.
Progressive Enhancement as Practical Strategy
Progressive enhancement isn’t just a technical approach—it’s a business strategy that aligns with core web values:
- Inclusivity: Works for more users in more contexts
- Performance: Provides faster initial content
- Reliability: Continues functioning under suboptimal conditions
- Maintainability: Creates clearer separation of concerns
- Longevity: Reduces dependency on specific frameworks
These values translate directly to business metrics: wider audience reach, higher conversion rates, improved user satisfaction, and lower maintenance costs.
Conclusion
Progressive enhancement represents a return to the web’s core strength: the universal accessibility of content. By starting with HTML and HTTP primitives and layering enhancements on top, we create experiences that are both sophisticated and resilient.
This approach doesn’t reject modern tools or techniques—it simply places them in their proper context, as enhancements rather than requirements. HTMX and AlpineJS fit perfectly into this model, extending the web platform rather than replacing it.
As we’ve seen throughout this series, many of the web’s current challenges stem from forgetting its foundational principles. Progressive enhancement reminds us that the web’s power lies not in its ability to mimic native applications, but in its unique combination of accessibility, resilience, and reach.
In the next article, I’ll explore how these technical approaches affect team structure, and how we might build truly cross-functional teams that break down the artificial silos between frontend and backend development.