if one checkbox is checked, how to uncheck another?
<p>I have some problems with my calculator, I have five checkboxes (costOne, costTwo, costThree, costFour, costFive) </p>

<p>When I check <strong>costOne</strong>, then <strong>costTwo</strong> should turn off, but if I click on this <strong>costTwo</strong> (which then is turned off) then <strong>costOne</strong> should be turned off.</p>

<p>My code works only partly: when I click on the <strong>costOne</strong>, then you cannot click on the <strong>costTwo</strong> anymore (because it becomes disabled), but when I click on <strong>costOne</strong> it turns off and <strong>costTwo</strong> turns on at the same time - this is exactly what I want. </p>

<p>But I can't click <strong>costTwo</strong>.  </p>

<p>The first and the third input I need to have this linked behaviour.</p>

<p>Here is the relevant code: </p>

<pre><code>//calculator
var init = $('.switch input').on('click', function() {
    var value1 = 0;
    var value2 = 0;

    var costOne = $("#cost-one"),
        costTwo = $("#cost-three");


    if (costOne.is(':checked')) { 
        costOne.prop("checked", true);
        costTwo.prop("checked", false);
    } else { 
        costOne.prop("checked", false);
        costTwo.prop("checked", true);
    }

    init.filter(':checked').closest('tr').each(function() {
        value1 += (+$(this).find('span.cost-one').text());
        value2 += (+$(this).find('span.cost-two').text());
    });

    $('.counter-one span').eq(0).html(value1 + '&amp;nbsp;');
    $('.counter-two span').eq(0).html(value2 + '&amp;nbsp;');
});
</code></pre>