3 ms·
I like to use javascript to add a class of "with-js" to the body element immediately after the body tag. Then you can just use css to style everything dependent
by mike-cardwell 15y ago
I like to use javascript to add a class of "with-js" to the body element immediately after the body tag. Then you can just use css to style everything dependent on javascript. For example:
<body>
<script type="text/javascript">document.body.className='with-js';</script>
Then in CSS you might do this if you want a certain element to disappear only if javascript is enabled:
body.with-js #foo { display:none; }