How to hide parts of HTML when JavaScript is disabled?

后端 未结 8 2096
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 06:10

I\'m trying to accommodate users without JavaScript. (By the way, is it worth the effort nowadays?)

In one HTML file I\'d like part of it execute if scripts are on

8条回答
  •  灰色年华
    2021-02-07 06:33

    Default the bits you want to hide as styled as display:none and switch them on with jQuery or JavaScript.

提交回复
热议问题