How can you change the attached CSS file with Javascript?

前端 未结 4 412
囚心锁ツ
囚心锁ツ 2021-01-03 06:34

I was wondering, is it possible to change the attached stylesheet using JavaScript?

For example:



        
4条回答
  •  隐瞒了意图╮
    2021-01-03 06:55

    Another option is to toggle the disabled property of the link DOM element. According to Mozilla the disabled HTML attribute is non-standard, but the javascript property is. So if you're toggling it with JS you should be fine.

提交回复
热议问题