I'm trying select all "area" under one "Zone" using Jquery. But unfortunately its not working. Can you tell me what I'm wrong with this ?
<script>
$('#central_all').click(function () {
$(':checkbox.checkItem').prop('checked', this.checked);
});
</script>
<input type="checkbox" name="pre_central" value="" id="central_all"/> <strong>Central</strong> <br/>
<input type="checkbox" name="pre_marina_esplanade" value="" class="checkItem"/> Marina, Esplanade, Suntec
<input type="checkbox" name="pre_raffles_place" value="" class="checkItem"/> Raffles Place
<input type="checkbox" name="pre_chinatown" value="" class="checkItem"/> Chinatown
I want if Central checkbox is click then all other checkbox will be selected which have class name checkItem
. But it's not selected :(