select elements using display:block

前端 未结 8 2121
旧巷少年郎
旧巷少年郎 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:39

    This may help you with several selectors CSS Selectors.

    As for your requirement, You can use this to select all div with display:block under the #report.

    $('#report div[style*=display:block]')
    
    0 讨论(0)
  • 2021-01-20 16:43

    You could use:

    $("[style='display: block;']");
    

    but I wouldn't, I'd add a class as well to hook onto.

    0 讨论(0)
提交回复
热议问题