Last week, my buddy David Putney asked:
I was reading your blog post about progressive enhancement.
It suggests adding a
jsstyle to the body tag and then keying all my js active state items to that style.
In the past, I’d loaded the page with a
no-jsstyle on the body tag and then removed it via js. My
no-jsversion was keyed to this
Is there a difference? It seems to work either way, but there might be something that I’m not seeing.
Great question! Here’s my response (posted with David’s permission, of course).
Practically speaking, both approaches—a
.no-js class that gets removed by your script and a
.js class that gets added by it—achieve the same result.
The difference between the two is purely conceptual.
Get the Spare Parts Newsletter
Every week, I send out a short email packed with web development resources and interesting stuff from around the web.