I am new to jQuery, so I hope for help.
I am creating a page with a div that has several checkboxes inside.
Each of these flags is also contained in its own div.
<div>
<div>
<input type='checkbox' name='cb1' />
<div id="info1">
Hide
</div>
</div>
<div>
<input type='checkbox' name='cb2' />
<div id="info2">
Hide
</div>
</div>
</div>
I need to write a jQuery function that can be captured whenever a flag is clicked (cb1 or cb2) to hide / show it with the corresponding "info" div (info1 or info2).
I will have over 100 flags, so I hope there is a way to do this without having to write more than 100 functions for click ().
Thanks
Mark
source
share