Determine if CSS property is set to a certain value?

后端 未结 3 1542
太阳男子
太阳男子 2021-01-31 15:16

Just wondering how to determine a jQuery statement like this

if( $(\"#test\").css(\'display\', \'block\') == true) {
   return true;
}

Basicall

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 15:54

    I think the only way to test this is by comparing with actual values:

    function displayHidden(elem) {
        return $(elem).css('display') === 'hidden';
    }
    

提交回复
热议问题