Immediately I started today, the day began along the way, in general, not just from the wrong foot, but not even from that day. :)
There is a form in it checkboxes.
<div class="size"> <span>16.0</span> <input type="checkbox" class="checkbox" value="16.0" name="sizes"> </div> <div class="size"> <span>17.0</span> <input type="checkbox" class="checkbox" value="17.0" name="sizes"> </div>
div size is a block in which the size is written. When you click on it, the class changes to size_active so that you can visually see what you have selected, we don’t show the checkbox itself
$(".size").click (function () { $(this).removeClass("size"); $(this).addClass("size_active"); $(this).find(":checkbox").attr("checked", "checked"); });
Further, if we do not need this checkbox or accidentally clicked, then we need to return the class back and remove the checked attribute. I wrote on the stupid, but did not react, most likely I missed something because I got up on the wrong foot.
$(".size_active").click (function () { $(this).removeClass("size_active"); $(this).addClass("size"); $(this).find(":checkbox").removeAttr("checked"); });
everything is described in
$(document).ready(function(){
The task is simple, I'm stupid wildly, either it's time to retire, or I need a rest.