Hacker News new | ask | show | jobs
by zichy 1235 days ago
Those "toggle buttons without JavaScript" are one of my pet peeves. It's always the same thing:

1. Someone finds out that you can use `:checked`.

2. They add some JavaScript to "enhance" their idea.

3. It's still less accessible than a proper implementation.

This example is a CSS hack and not something you would actually want to use in a production environment. JavaScript is absolutely necessary if you are developing a custom interactive element. If `<details>` works for you, fine. If it doesn't, you might want to look up ARIA attributes.

1 comments

You didn't actually say anything other than that it's bad and not to use on production. Care to elaborate?