logoalt Hacker News

nextaccounticyesterday at 9:06 PM1 replyview on HN

what about, make it work in pure html and css, and enrich it with js to make it accessible?

rather than not working at all with js disabled


Replies

jakelazaroffyesterday at 10:51 PM

That's actually a common strategy called "progressive enhancement". The only thing is that your order is backwards: you should first make it accessible in pure HTML and CSS, and then use JavaScript to layer your fancy interactions on top.

So, for the tabs example, your baseline pure HTML and CSS solution might involve showing the all tab panels simultaneously, stacked vertically. Once the JavaScript loads, it would rearrange the DOM to hide all but one and add the tab-like behavior.