Change CSS of class in Javascript?

前端 未结 8 713
春和景丽
春和景丽 2020-12-01 17:53

I\'ve got a class with the display set to none I\'d like to in Javascript now set it to inline I\'m aware I can do this with an id wit

8条回答
  •  隐瞒了意图╮
    2020-12-01 18:41

    You can do that — actually change style rules related to a class — using the styleSheets array (MDC link, MSDN link), but frankly you're probably better off (as changelog said) having a separate style that defines the display: none and then removing that style from elements when you want them no longer hidden.

提交回复
热议问题