Please note that the scenario is ASP.NET Webforms + Master - Content page which mess up the ids.
I have, say, three checkboxes
<asp:CheckBox ID="chkConsultantQuality" runat="server"
CssClass="company"/>
<asp:CheckBox ID="chkConsultantEnvironment" runat="server"
CssClass="company"/>
<asp:CheckBox ID="chkConsultantSafety" runat="server"
CssClass="company"/>
I would like to make a div id="CompanyPanel"
on click event of each checkbox according to the following condition
- visible if any of the checkboxes are checked.
- hidden if all of the checkboxes are unchecked.
I am planning to use jQuery since I am selecting by class name. I could do it with jQuery.each
on the class='company' by checking each for a checked flag.
Any better ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…