HTML “link” (stylesheet) disabled attribute

前端 未结 3 1788
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 22:44

I\'m using JavaScript to enable/disable stylesheets using the following:

document.styleSheets[0].disabled = true|false;

This JS works fine,

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 23:20

    I think in this case you may have to rely on JavaScript.

    If you think more down the lines of serving up the style-sheet if needed rather than disabling by default you should nail it.

提交回复
热议问题