What is the purpose of the HTML “no-js” class?

后端 未结 7 1184
误落风尘
误落风尘 2020-11-27 08:59

I notice that in a lot of template engines, in the HTML5 Boilerplate, in various frameworks and in plain php sites there is the no-js class added onto the

7条回答
  •  难免孤独
    2020-11-27 09:21

    The no-js class is used to style a webpage, dependent on whether the user has JS disabled or enabled in the browser.

    As per the Modernizr docs:

    no-js

    By default, Modernizr will rewrite to . This lets hide certain elements that should only be exposed in environments that execute JavaScript. If you want to disable this change, you can set enableJSClass to false in your config.

提交回复
热议问题