Live data from Hacker News

Replacing JavaScript with Just HTML

htmhell.dev

231–240 of 296 posts

Re: Replacing JavaScript with Just HTML

#231
post #145

Just been through several frontend interviews in the last few months, where it's clear that they still judge a developer's JS skills (especially React) than being semantically correct on HTML elements. Every question/exercise is centred around how well you know React hooks, effect, memoization, modern css-in-js etc. Given I've been working with Astro recently, in one interview I talked about DOM APIs and I can see th…

Remember that a large part of hiring is finding someone who fits in an existing team. A team that uses react won't appreciate someone choosing to use native DOM APIs instead of a react component.

Weird comment, I'm a web dev that has been using react for 10+ years and I prefer using native browser features whenever possible. I'd honestly avoid hiring framework specific devs because the skills required are never about just one single framework.

Also this is just all JS + HTML here, let's not act like it's impossible to learn the most popular frontend tool at the moment.

Re: Replacing JavaScript with Just HTML

#232

Before anyone wastes a lot of time like I did trying to use the popover API: it is not ready yet. You can do very basic things in all browsers but positioning is still different and/or totally broken per browser.

Yes, HTML & CSS alone won't replace JS. Of course, for complicated form validation HTML is not sufficient. But IMHO it's very important to provide basic functionality in HTML / CSS as much as possible / reasonable. Moving the functionality to HTML / CSS can potentially improve the SEO.

As for positioning, there is an experimental feature @position-try. Here I made a small demo where it handles overflows.

https://waspdev.com/articles/2025-06-29/css-features-web-dev...

But yeah, that's kind of limited if you need nice animations or some other complicated thing. Although it's fun.

Re: Replacing JavaScript with Just HTML

#233

The interesting part here isn’t “no JavaScript”, it’s that HTML already covers more use cases than people remember (forms, dialogs, validation, navigation). I ran into this repeatedly while writing my book "You Don’t Need JavaScript"[0]: most JS in these cases isn’t adding capability, it’s compensating for forgotten platform features. [0] https://theosoti.com/you-dont-need-js/

Very interesting book! These are the types of programming books I wish that were more abundant rather than "Learn X framework/language," those that solve/discuss interesting problems. Just bought a copy.

Indeed the "Learn X" books may even have a vested interest in not revealing rarely used features, so that you learn to reimplement them in X.

Re: Replacing JavaScript with Just HTML

#234
One good thing about NOT having JS is what the page can function in Tor Browser's "Safest" mode!

A step down is to have JS only on your domain. "Safer" mode.

Try to avoid web site that require "Standard" to view and run properly.

Re: Replacing JavaScript with Just HTML

#236

Earlier quoted context omitted.

> Expecting users to press modifiers when clicking on these is so funny. I mean… 5 year olds can figure out shift-click in Minecraft.

Trying to figure things out in a game is fun! Trying to figure things out on a website is a sign the UI sucks.

Learn it in a game, then use it on a website. It's a UI convention, not merely a quirk to a multi-select list.

Re: Replacing JavaScript with Just HTML

#237
I was stuck on the backend while CSS3 absorbed most of the functionality of Less and Sass and now I’m trying to play catchup. If there had just been a CSS4 I’d be able to find a tutorial to teach me everything I missed in the interim.

Re: Replacing JavaScript with Just HTML

#239

Before anyone wastes a lot of time like I did trying to use the popover API: it is not ready yet. You can do very basic things in all browsers but positioning is still different and/or totally broken per browser.

Yes, popover's uses are limited without CSS anchor positioning but it will be supported in all major browsers very soon.

In the meantime, there is a polyfill to load in browsers without support.

https://caniuse.com/css-anchor-positioning

Re: Replacing JavaScript with Just HTML

#240
post #128

Earlier quoted context omitted.

My point was that js would be vastly more complicated than these html/css "incantations".

Most front end engineers could do it in JS without ever having to look something up. But the CSS to do it is still obscure to most.

so, why not answer my question and say how you'd do it in js...?
Post reply on HN