I have found numerous partial answers to this question, but nothing that seems like a definitive answer. For such an important technique I find this a little strange.
To be clear. I'm not asking how to handle displaying content to users who don't have JS. That is an entirely different subject. I just want a reliable way to hide HTML elements before they are displayed.
So my requirements:
- HTML elements are not hidden initially using CSS
- If JS is available, these elements are hidden so that they are never displayed, not even for an instant. This means hiding them from JS loaded at the end of the body is out).