Changing a CSS rule-set from Javascript

前端 未结 8 1352
甜味超标
甜味超标 2020-11-22 04:54

Is it possible to make changes to a CSS rule-set dynamically (i.e. some JS which would change a CSS rule-set when the user clicks a widget)

This particular CSS rule-

8条回答
  •  没有蜡笔的小新
    2020-11-22 05:58

    You can, but it's rather cumbersome. The best reference on how to do it is the following article: Totally Pwn CSS with Javascript (web archive link).

    I managed to get it to work with Firefox and IE - I couldn't in Chrome, though it appears that it supports the DOM methods.ricosrealm reports that it works in Chrome, too.

提交回复
热议问题