Answer the question
In order to leave comments, you need to log in
How to make a checkbox inactive when a select value is selected?
Hello, how to implement using JS so that when choosing a size from the select from the checkbox, the M size becomes inactive
<select name="selectsize" id="" class="modal-select" required>
<option selected disabled value="">Выберите размер</option>
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
</select>
<div class="modal-checkbox">
<label><input type="checkbox" name="selectcolor[]" value="Черный">Черный</label></br>
<label><input type="checkbox" name="selectcolor[]" value="Красный">Красный</label></br>
<label><input type="checkbox" name="selectcolor[]" value="Розовый">Розовый</label></br>
<label><input type="checkbox" name="selectcolor[]" value="Леопард">Леопард</label></br>
</div>
Answer the question
In order to leave comments, you need to log in
The question is not very clear.
$('select').on('change', function(){
if($(this).val() == 'какой-то размер'){
$('.checkbox').prop('checked', false);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question