Changing Style Sheet javascript

后端 未结 3 1519
太阳男子
太阳男子 2020-12-01 11:31

I got this HTML code:


    

        
3条回答
  •  再見小時候
    2020-12-01 12:03

    Transform "default".css into "default.css". Do the same for dark.css.

    Then onclick takes a function as a value.

    style1.onclick = function () { swapStyleSheet("default.css") };
    style2.onclick = function () { swapStyleSheet("dark.css") }; 
    

提交回复
热议问题