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.
<div id="report">
<div id="p1" style="display: block;">
<input id="pname1" type="checkbox" name="report1">
<input id="pname2" type="checkbox" name="report2">
</div>
<div id="p2" style="display: none;">
<input id="pname1" type="checkbox" name="report1">
<input id="pname2" type="checkbox" name="report2">
</div>
<div id="p3" style="display: none;">
<input id="pname1" type="checkbox" name="report1">
<input id="pname2" type="checkbox" name="report2">
</div>
<div id="p4" style="display: block;">
<input id="pname3" type="checkbox" name="report1">
<input id="pname4" type="checkbox" name="report2">
</div>
</div>
Maybe you can use this piece of jQuery :
Or this one 🙂 ?