news.volyx.in

Replacing JavaScript with Just HTML (htmhell.dev)

748 points by soheilpro · 207 days ago · 285 comments on HN

Article summary

The article discusses replacing JavaScript with HTML for certain tasks, such as creating accordions, input with autofilter suggestions, modals, and offscreen navigation. It provides examples of how HTML elements like details, summary, and datalist can be used to achieve these tasks without JavaScript. The article aims to promote the use of native HTML features to reduce reliance on JavaScript and improve user experience. By using HTML, developers can create more efficient and accessible web pages.

Main themes

  • Replacing JavaScript with HTML
  • Native HTML features
  • Web development best practices
  • Accessibility
  • Performance optimization
  • HTML vs JavaScript

What commenters say

  • Using HTML-only solutions can be limited in certain cases, such as when dealing with typos or complex filtering, and may not be suitable for all use cases.
  • Starting with simple HTML solutions and adding complexity later is a good approach to web development.
  • Some commenters argue that adding complexity from the start can be beneficial to ensure a good user experience, while others believe that simplicity should be the default approach.
  • The details and summary elements are powerful tools for creating accordions and other interactive elements, but may have limitations, such as lack of animation support.
  • Animations can be useful for guiding users and explaining causal relationships, but can also be overused and distracting.
  • The use of native HTML features can improve accessibility and performance, but may not be supported equally across all browsers.
  • Some commenters believe that animations are necessary to help users understand what is happening on the page, while others think they are often unnecessary and annoying.
  • The article's approach to replacing JavaScript with HTML is seen as a good way to promote simplicity and efficiency in web development, but may not be applicable to all situations.