There are several checkbox-ов , you need to select 1 or 2 checkbox , and the rest are chosen independently of them. id , name do not change as used in the program.
$('#count').keyup(calculate); function calculate() { if ($("#Bort").is(':checked')) sum += 1400; if ($("#Borta").is(':checked')) sum += 2800; } $('input.kartinki').on("click", function() { if ($('#Bort').prop('checked')) { $('#image').attr('src', 'img/kartinki_chekbox/belava/bl_l_310.jpg'); } else if ($('#Borta').prop('checked')) { $('#image').attr('src', 'img/kartinki_chekbox/belava/bl_p_310.jpg'); } }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <label for="Bort">1</label> <input class="kartinki" name="Борт" type="checkbox" id="Bort" /> <label for="Borta">2</label> <input class="kartinki" name="Борта" type="checkbox" id="Borta" /> <label for="morilka">3</label> <input name="Морилка" type="checkbox" id="morilka" />
нужно чтобы выбирался 1 или 2 checkbox, а остальные выбирались независимо от них. idнужно чтобы выбирался 1 или 2 checkbox, а остальные выбирались независимо от них. idis a piece from a question that I didn’t quite understand - Airtype="radio"? - Air