select elements using display:block

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

    $("#report > :visible") 
    

    This will select the direct children of #report that are visible. Without the space you're selecting #report itself if it's visible. (Without the > it'd target also the inputs.)

提交回复
热议问题