Is there a selector to exclude display: none elements?

前端 未结 6 2190
醉话见心
醉话见心 2021-02-19 23:22

I want to select only whose parents have display: block and exclude those whose parents have display

6条回答
  •  故里飘歌
    2021-02-19 23:55

    There are no such selector available in CSS to select by their property values. You can try something with jquery by using :hidden selector to find buttons with display:none. Check below snippet for reference.

    $( ".btnShow" ).click(function() {
      $( ".btn:hidden" ).show( "fast" );
    });
    .hidden{
      display:none;
    }
    .btnShow{
      display:block;
      margin-top: 50px;
    }
    
    
    
    
    
    
    
    
    

提交回复
热议问题