Check, using jQuery, if an element is 'display:none' or block on click

后端 未结 7 1450
我在风中等你
我在风中等你 2020-11-28 17:56

I want to check and sort elements that are hidden. Is it possible to find all elements with attribute display and value none?

7条回答
  •  我在风中等你
    2020-11-28 18:14

    Yes, you can use the cssfunction. The below will search all divs, but you can modify it for whatever elements you need

    $('div').each(function(){
    
        if ( $(this).css('display') == 'none')
        {
           //do something
        }
    });
    

提交回复
热议问题