There are two checkboxes. One is immediately marked, the second is not. It is necessary when you click on the checkbox, both changed the checked state to the opposite of what is now. If you click on only one checkbox, then everything is ok. But if after clicking on another - everything breaks down.
In any case, there must be at least one checkbox.
$('input:checkbox').click(function () { if( !$(this).is(':checked')) { $('input:checkbox').not(this).eq(0).attr('checked', 'checked'); $(this).eq(0).removeAttr('checked'); } else { $('input:checkbox').not(this).eq(0).removeAttr('checked'); $(this).eq(0).attr('checked', 'checked'); } }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="checkbox" name="recruiter-switch" class="onoffswitch-checkbox" id="recruiter" checked> <input type="checkbox" name="company-switch" class="onoffswitch-checkbox" id="company">
radio button's not pleased? They are just for this purpose and intended. - Cheg