At the moment in the <head>
of my site I have
<script>
document.write('<style>.jshide{display:none},.jsshow{display:block},.jsblank{visibility:hidden}</style>')
</script>
The idea is that some elements on my site I don't want to display if JS is enabled. For example, maybe a form submit button, because if JS is enabled the form works with an ajax dropdown instead.
I could hide them programmatically with JS script once the page has loaded, but that leads to frustrating flickering etc.
I've had this for getting on for a decade though, and I wonder if there's a better way to achieve the same end goal in these more modern times?
Thanks