Disclosure: I work on VibUI, a paid library of website prompts. It's linked once, at the end.
You open the file for the FAQ section and find a hundred and forty lines of JavaScript. State variables, event listeners, an animation timer. The thing it does is open and close a box.
HTML has had an element for that for years. AI tools write the script version a lot, because the examples they learned from did. Here are five spots where you can delete code and keep the behaviour.
1. Accordions
<details> <summary> Is there a free plan? </summary> <p> Yes, with limits. See the pricing section. </p> </details>
Enter fullscreen mode
Exit fullscreen mode
Keyboard support and screen reader semantics come free. Style the marker in CSS if you want.
2.…