select elements using display:block

前端 未结 8 2133
旧巷少年郎
旧巷少年郎 2021-01-20 15:52

This is the html content from which I want to select all elements inside report having display block using jQuery $(\"#report:visible\") does not work for me.

8条回答
  •  一向
    一向 (楼主)
    2021-01-20 16:29

    This should work:

    $("#report *").filter(function(){
        $(this).css("display") === "block";
    });
    

    The * selects all elements within the #report. You're then filtering them to those with CSS property set to block.

提交回复
热议问题