Member-only story

Sorry, I’m Not Diggin’ HTMX

Kenton de Jong
6 min readJan 6, 2024

--

HTMX === HTML Extended?

I know I’m one to always rain on somebody’s parade when it comes to emerging tech, but since I first heard of HTMX, I wasn’t a fan.

I think it has something to do with the fact that HTMX describes itself as “a library that allows you to access modern browser features directly from HTML, rather than using JavaScript” but the first step in using HTMX is to include a JavaScript library:

<script src="https://unpkg.com/htmx.org@1.9.10" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>
Sorry, come again?

What would have made me more impressed was if they used a language other than JavaScript to do it. For example, something like Blazor, which uses WebAssembly, or Brython, which while technically is still JavaScript, but is written with Python. I can appreciate out-of-the-box solutions, but claiming you’re not using JavaScript, while using JavaScript, made me wonder if this was some kind of joke about the ever growing number of JavaScript libraries.

Unfortunate spoiler: it is not.

But, that was enough to make me shrug off the idea of HTMX. However, I keep hearing about it, all over X and Reddit, especially how easy it is to incorporate into projects. How much easier than regular JavaScript. How much easier? Easier? Easier?? I didn’t really get it.

But what really got me wanting to learn more about this framework was Jason Knight’s HTMX, The “Framework Stupid” Gets Dialed Up To Eleven! Knight’s posts are always a fun read, and he made some solid points that made me realize, if HTMX isn’t going to take themselves seriously, neither should I.

To begin, HTMX has a few core “motivation” points explaining why it’s necessary, and none of them really make sense to me.

1. Why should only <a> and <form> be able to make HTTP requests?

They aren’t. <img> tags do as well, as do other media tags like <audio>, <video>, <iframe>, <embed> , <frame> and tags like <link> and <script> .

2. Why should only click &

--

--

Kenton de Jong
Kenton de Jong

Written by Kenton de Jong

I am a web developer turned travel blogger that is forced to code to eat.

Responses (41)