> We’ll simply create a single class, d-js-required to indicate that JavaScript needs to be enabled for us to display this element.
You can run some JS to prove you're running JS. Can't you write in your site's CSS:
.d-js-required { display: none; }
and (in JS) remove that class on each element it's on?