Jquery if then statement for css value

后端 未结 2 1633
青春惊慌失措
青春惊慌失措 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

    0 讨论(0)
  • 2020-12-29 12:53
    if ($('div.x').css('height') === 'auto') {
        $('.y').removeClass('a');
    }
    
    0 讨论(0)
提交回复
热议问题