I have a simple bit of jquery which is running a trigger on click of a radio button to check my check boxes.
<script>
jQuery('#op5').click(function () {
$('input[type=checkbox]').trigger('click');
});
</script>
These are my checkboxes they have labels to give them a custom style.
<input type="checkbox" certificate="true" checked="checked" id="gridcb0" siteid="1381" value="72218" class="custom selector checkedFocus">
<label for="gridcb0" class="white"> </label>
And this is the radio button I am clicking to check the checkboxes
<input type="radio" id="op5" value="1" name="options2" class="custom">
However it is not checking my check boxes on first click it requires me to click on the radio button op5 twice to check the boxes, I do not want to run the line below twice to highlight these check boxes
<input type="radio" id="op5" value="1" name="options2" class="custom">
Suggestions?