Javascript, fastest way to remove a class from `<body>`

后端 未结 5 904
不知归路
不知归路 2021-01-31 09:44

I have a body element on which I add a few classes. And I want to remove the no-javascript class from it, after it\'s being read by the browser.

           


        
5条回答
  •  南笙
    南笙 (楼主)
    2021-01-31 10:25

    You can avoid all of that work simply by using

    
    

    Since whatever you put inside of noscript tag will be shown if Javascript is turned off and nothing will be shown if JS is turned on.

提交回复
热议问题