frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Replacing JavaScript with Just HTML

https://www.htmhell.dev/adventcalendar/2025/27/
109•soheilpro•2h ago

Comments

theandrewbailey•1h ago
> Input with Autofilter Suggestions Dropdown

It's great until you have a typo in the field, or want to show options that don't start with what you typed in but appear near the end of an option (think Google search's autocomplete). There's no way to filter in Javascript and force it to show certain options with <datalist>. I've resorted to <ol> for search suggestions.

prisenco•1h ago
When building out a new app or site, start with the simplest solution like the html-only autofilters first, then add complex behavior later.

It's good to know these things exist so there are alternatives to reaching for a fat react component as the first step.

willparks•1h ago
It’s great to see practical examples that push us to consider what the platform already offers before adding more layers of complexity.
zdragnar•1h ago
Until your client tells you that it doesn't work in Edge and you find out it's because every browser has its own styling and they are impossible to change enough to get the really long options to show up correctly.

Then you're stuck with a bugfix's allotment of time to implement an accessible, correctly themed combo box that you should have reached for in the first place, just like what you had to do last week with the native date pickers.

smlavine•1h ago
The Pentagram at the top of the page does not load without JS enabled.
bitbasher•1h ago
So it's.. fitting, how meta.
superkuh•1h ago
Some of these new HTML features don't fully work in my "ancient" browser. But all of them partially work (ie opening the accordion element doesn't close others but it still opens and closes) and they still remain functional elements I can read and interact with. This puts them far ahead of any javascript implementation which almost universally fail to nothing.
ravenstine•1h ago
What "ancient" browser are you using?
vpShane•37m ago
Probably something 300 CVEs ago.
subdavis•1h ago
The details / summary thing absolutely kills me. There’s basically nothing you can’t do with them. Hiding and replacing markers is easy. But every component library just pretends they don’t exist.

It even saves you the effort of all the aria control and expanded tags: these tags don’t need them.

webstrand•1h ago
Details works even when it's set display:contents too, for even more flexibility. Can't animate from open›close, yet, though. That's pretty much my last frustration with it.
shakna•1h ago
I think the CSS support for that has finally landed, though it means targetting a pseudo element instead. Its been a year, so support is probably good enough you don't care if just the animation doesn't happen.

https://developer.chrome.com/blog/styling-details

raybb•11m ago
Do they work well for when you want to preview text? Like show the first 100 characters of a paragraph and then click to expand?
only-one1701•1h ago
Something I keep thinking about when I consider the trade-offs between building a site with HTML/CSS wherever possible vs JS is what the actual _experience_ of writing and maintaining HTML/CSS is vs JS. JS gets knocked around a bunch compared to "real" languages (although less so in recent years), but at the end of the day, it's a programming language. You can write a loop in it.

Writing a web server in C++ is a way to get excellent performance. So why don't most people do it?

suprjami•1h ago
Gimme a dark/light mode switch. CSS is allowed.
johnisgood•1h ago
Checkbox and :checked are your friends.
adzm•1h ago
Use a checkbox, d. Define vars for light mode. Override when checked for dark mode with body:has(#d:checked) and can include the dark mode media query too
ronbenton•1h ago
One thing I am quite hopeful for is customizable selects! It's in WHATWG stage 3 right now. I have seen so many horrors with javascript-based custom dropdowns components. https://developer.chrome.com/blog/a-customizable-select
odie5533•52m ago
The Popover API looks really cool. Could see it for tooltips or lightboxes.
cantalopes•41m ago
The problem is that it's difficukt to style or animate those things. Unless you're builsing something for dun or technical where it's not important it's fine but i doubt any real world commercial project would be satisfied with just this
overflowy•29m ago
HTML and JavaScript serve distinct purposes, making better or worse comparisons logically flawed. Complex/interactive web apps requires JavaScript, period. Attempting to build sophisticated apps solely through HTML (looking at you HTMLX) eventually hits a functional ceiling.
mcny•12m ago
It shouldn't have to be this way though. There is no reason html can't do things it needs to do to build complete apps. We could use reasonable defaults to allow a new type of html markup without JavaScript.

All the http verbs. Decent html input controls What else?

imbusy111•11m ago
I assume you mean htmx. It doesn't have to be either/or. You can supplement htmx with Javascript.

The core idea with htmx is that you transfer hypertext with controls and structure built in, not just a JSON blob that requires additional context to be useful.

I have just shipped a very useful and interactive app surprisingly quickly for my customer using just htmx with a little Javascript.

dpedu•15m ago
I didn't know about <datalist>, but how are you supposed to use it with a non-trivial amount of items in the list? I don't see how this can be a replacement for javascript/XHR based autocomplete.
reed1234•13m ago
> If we can hand-off any JS functionality to native HTML or CSS, then users can download less stuff, and the remaining JS can pay attention to more important tasks that HTML and CSS can't handle (yet).
psnehanshu•12m ago
You can't. It's only supposed to be used for a limited list.
econ•8m ago
I'm so not impressed by the toggle implementation... How nice it could have been.

Nesting the elements is a truly hideous choice. The summary is part of the details?? I thought they were opposites.

Should we also put the headings in the <p> from now on?

Identifying a target should be done by id or by name. That it does use a name because js can't target it without makes it even more stupid.

We already had labels for form fields. Inventing a completely different method for something very similar is a dumb idea. The old checkbox hack is more flexible and less ugly for some implementations.

Why force the hidden content to be below or above the toggle? We aren't gaining anything with this.

What is this nonsense for an element to not just be hidden or displayed but to have some weird 3rd state where only one of its children is shown?

How should styling it even work for this new state? If I apply a style to the hidden content it must also apply to the link? The text is hidden but the style is visible??? Preposterous!

Don't try style <details> to avoid unexpected behavior. Try wrapping the hidden content in a new element to make it behave normally.

What is this ugly arrow? If you find 1000 websites using a toggle I doubt there is one using an ugly arrow like that.

The default styling gives no clue about it being clickable?

The pointer (awkwardly called the cursor) choice is the text selection?????

Blue underlined "more" is what everyone does and everyone is used to. The cursor should be pointer. (This is css speak for "the pointer should be a hand")

The number of js toggles you can find online where the button lives inside the hidden text is guaranteed to be zero. Forget about drop in replacement, you will have to reinvent your css.

Maybe I'm dense but I also want my url to reflect the state of the page. I would have been impressed if that was supported. Personally I use actual links and disable default action in the listener if js is enabled/working or modify the state on the server if js isn't available/working.

It would have been great if the toggle action was implemented as a simple attribute something like toggle="element name" so that anything can be clickable and anything can be toggleable. Have a "closed" as well as an "open" attribute for the target.

Doesn't seem very hard. An open/closed attribute would be useful for other things too. Using display:none is terrible as display: is used for many things.

anidsiam•7m ago
Your blogs have very small amount solution, but the JS use cases are very large. How this little replacement can do more thing? I usually like the idea of being using as lean as possible, if it's can be possible to do more thing just with HTML and CSS that's obviously cool. Is it really possible to replace JS with HTML in near future?

BTW the toggle solution (expanding content) is good.

Cursed Bundler: Using Go Get to Install Ruby Gems – Andrew Nesbitt

https://nesbitt.io/2025/12/25/cursed-bundler-using-go-get-to-install-ruby-gems.html
1•hboon•1m ago•0 comments

The Boss Who Gave His Employees a $240M Gift

https://www.wsj.com/business/fibrebond-eaton-bonus-walker-30844d62
1•sebmellen•2m ago•0 comments

Show HN: A 12KB Deterministic AI Kernel for Robotics (Bestbrain-Core)

https://codeberg.org/ishrikantbhosale/bestbrain-core
1•setmd•3m ago•0 comments

Timeline for your Apple Devices – stored locally

https://github.com/kennym/find-my-timeline
1•hellokenny•4m ago•1 comments

Resisting Authoritarianism in Today's Classrooms

https://www.laprogressive.com/education-reform/resisting-authoritarianism
1•hkhn•7m ago•0 comments

Radial Hyperbolic Architecture – 37D golden-ratio lattice in Poincaré disk

https://github.com/robertjeffrey1236/Radial-Hyperbolic-Architecture-Prototype
1•Robertjeffrey12•9m ago•0 comments

Claude Code creator Boris Cherny landed 259 PRs in 30 days, all by Opus 4.5

https://xcancel.com/bcherny/status/2004947522889162834
1•odie5533•13m ago•1 comments

Tesla's Dangerous Doors

https://www.bloomberg.com/news/videos/2025-12-17/tesla-s-dangerous-doors-video
3•xqcgrek2•13m ago•0 comments

Flathub Year in Review

https://flathub.org/en/year-in-review/2025
1•Charmunk•22m ago•0 comments

Face Antispoof ONNX

https://github.com/johnraivenolazo/face-antispoof-onnx
1•handfuloflight•43m ago•0 comments

Video Essays of 2025

https://www.bfi.org.uk/sight-and-sound/polls/best-video-essays-2025
2•vinhnx•48m ago•0 comments

Why are we worried about memory access semantics? Full barriers are enough?

https://devblogs.microsoft.com/oldnewthing/20251226-00/?p=111919
1•signa11•48m ago•0 comments

Publishers Clearing House's bankruptcy means winners will no longer get paid

https://www.cnn.com/2025/09/16/business/publishers-clearing-house-bankruptcy-winners-lose-prizes
1•petethomas•51m ago•2 comments

The Well Watchers

https://www.motherjones.com/environment/2025/12/abandoned-oil-wells-texas-tiktok-hawk-dunlap-sara...
2•toomuchtodo•57m ago•0 comments

Ask HN: Can systems function correctly without memory?

1•SpicyG•58m ago•4 comments

The iOS Weekly Brief – Issue #40

https://vladkhambir.substack.com/p/the-ios-weekly-brief-issue-40
1•khambir•59m ago•0 comments

Andrej Karpathy: "I've never felt this much behind as a programmer"

https://twitter.com/i/status/2004607146781278521
4•alexcos•1h ago•2 comments

Geographic shapes and flags via simple URLs

https://borderly.dev/
2•zuhayeer•1h ago•0 comments

GitHub Takes Down Rockchip MPP Repository After FFmpeg Copyright Claim

https://linuxiac.com/github-takes-down-rockchip-mpp-repository-after-ffmpeg-copyright-claim/
4•marcodiego•1h ago•0 comments

Lost Years: Expected Number of Years Lost

https://github.com/gojiplus/lost-years
1•neehao•1h ago•0 comments

Ask HN: Why does YouTube collect creator demographics?

1•journal•1h ago•0 comments

Make Your iPhone Speak the Time

https://swordandsignals.com/2025/12/27/announce-time-on-demand.html
1•jiannengli•1h ago•0 comments

Show HN: tpmjs - npm for ai sdk tools

https://tpmjs.com/
4•thomasfromcdnjs•1h ago•1 comments

Fathers’ choices may be packaged and passed down in sperm RNA

https://www.quantamagazine.org/how-dads-fitness-may-be-packaged-and-passed-down-in-sperm-rna-2025...
36•vismit2000•1h ago•4 comments

Change, How Expensive

https://johnocens.com/soothfare/changehowexpensive
2•wonderbar•1h ago•0 comments

Bluetooth Headphone Jacking: Full Disclosure of Airoha Race Vulnerabilities

https://insinuator.net/2025/12/bluetooth-headphone-jacking-full-disclosure-of-airoha-race-vulnera...
2•marvinborner•1h ago•1 comments

2026 macro outlook – views across the street (synthesis 2026 outlook reports)

https://2026macro.vercel.app/
1•OxfordOutlander•1h ago•1 comments

Would You Kill for a Job?

https://www.nytimes.com/2025/12/27/opinion/no-other-choice-work-unemployment.html
3•mitchbob•2h ago•5 comments

Replacing JavaScript with Just HTML

https://www.htmhell.dev/adventcalendar/2025/27/
112•soheilpro•2h ago•29 comments

The case of Africa's 'vanishing' carbon deals

https://www.japantimes.co.jp/environment/2025/11/26/climate-change/africa-carbon-deals/
2•PaulHoule•2h ago•0 comments