Tell me, I encountered the following problem, there is such a thing on HTML:
$('.check_group').click(function () { var check = $(this).children('input')[0]; check.checked = !check.checked; alert(check.checked); //Дальше собираюсь убирать/показывать все чекбоксы в соседних div });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div class="check_group" style="background-color: rgb(200, 138, 59);"> <input type="checkbox" /> - Выбрать все </div>
So, when you click on the checkbox, the state of the checkbox changes, and then jQuery is triggered and the state changes back.
How to make it so that when you click on the div / checkbox - the checkbox changes and there is an alert that something happened.