How to override css containing '!important' using jquery?

前端 未结 15 658
清歌不尽
清歌不尽 2020-12-29 21:05

I want to apply height for specific div using jquery but not able to override the \'!important\' keyword using jquery.

Here is

15条回答
  •  北海茫月
    2020-12-29 21:08

    inline style fails to override the !important given in stylesheets.

    Therefore !important can be overridden only by using !important along jQuery

    Try like

    $('#divL3.myclass').attr('style', 'height: 0px !important');
    

提交回复
热议问题