Why would a HTML page have a class of ‘javascript’?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is a common practice for a page to degrade gracefully in case JavaScript is disabled. For example, instead of a JavaScript slider you may want to present a combo box, or extra submit buttons. This may be required for accessibility and compatibility.
One way of doing so it to load the page ready for JavaScript-disabled clients, and use JavaScript to add a class to the
<body>element (or other elements). CSS rules can use this class to change the look of the page – when you know JavaScript is enabled (after you’ve just run it), you can hide these controls, and rely on a richer interface.