I am on jQuery 1.3.2
I need a very simple code.
I have 4 checkboxes.
One of these checkboxes is hidden.
I want that when one of the 3 visible checkboxes is clicked the hidden one will be automatically checked.
So I have
<input type="checkbox" style="display:none" id="hiddenOne">
<input type="checkbox" style="display:block" id="visible2">
<input type="checkbox" style="display:block" id="visible3">
<input type="checkbox" style="display:block" id="visible4">
So if I click on any visible2 3 or 4 the hiddenOne will be automatically checked.
Is there a way to do that in jQuery?
Thank you!
this will check if any of the three visible’s are checked, if any are then show the hidden one and check it.
http://jsfiddle.net/pxfunc/S6SFZ/
HTML:
jQuery: