views:

1671

answers:

2

I want to check whether a div with a css class="x" has height="auto". If yes I want (with a jquery script) the css-class="a" removed from all elements with the css-class="y". If not the script does not have to do anything. thanks

+2  A: 
if ($('div.x').css('height') === 'auto') {
    $('.y').removeClass('a');
}
Ken Browning
A: 
$(document).ready(function(){
  if ($('div.x').css('height') === 'auto') {
    $('.y').removeClass('a');
  }   

});

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

AutomatedTester