Jquery if then statement for css value

后端 未结 2 1651
青春惊慌失措
青春惊慌失措 2020-12-29 12:40

I want to check whether a div with a CSS class="x" has height="auto"

If yes I want (with a jQuery script) t

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 12:46

    $(document).ready(function(){
      if ($('div.x').css('height') === 'auto') {
        $('.y').removeClass('a');
      }   
    
    });
    

    You may need to do that within a each() call

提交回复
热议问题