How to find and remove a checked checkbox?
-
Good afternoon.
There are a number of checkboxes with the value value, which are displayed separately with a certain "checklist".
<section> <div id='result2'> <div class="md-checkbox" style="font-size:20px"> <input id="checkbox_4" type="checkbox" class="calkulator" data-check="0" data-rezsumm="1" value="Значение_1"> <label for="checkbox_4" id='cooler'>Значение_1</label> </div> </div> <div id='result3'> <div class="md-checkbox" style="font-size:20px"> <input id="checkbox_5" type="checkbox" class="calkulator" data-check="0" data-rezsumm="1" value="Значение_2" value="<button id="btn-off"> <label for="checkbox_5" id='cooler'>Значение_2</label> </div> <div class="md-checkbox" style="font-size:20px"> <input id="checkbox_6" type="checkbox" class="calkulator" data-check="1000"data-rezsumm="1" value="Значение_3."> <label for="checkbox_6" id='cooler'>Значение_3</label> </div> </div>
Tell me how to find checkbox by value and switch.
$('#result_4').html(''); $('.calkulator:checkbox:checked').each(function(){ $('#result_4').append($(this).val() + ' ' + '<button id=del>Сброс</button>' + '<br>'); $("#del").click(function() { $('[value= '$(this)']").prop('checked',false); }) });
jQuery Jaxon Shaffer, Dec 24, 2019 -
You can try thisAnonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!