How to detect if browser JavaScript is off and display a notice
I need to check if browser JavaScript is off, then display a error div instead of the body, how can I do this? <html class="no-js"> <head> <style> .error, .no-js #container { display: none; } .no-js .error { display: block; } </style> <script> document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, ''); </script> </head> <body> <div id="container"> rest of page </div> <div class="error"> sorry, no javascripty, no sitey! </div> </body> </html> Of course, this is usually a bad idea, but I hope you've already considered that. You'll need to do it the other way