Answer the question
In order to leave comments, you need to log in
How to refer to input through the value of a variable?
There is a piece of HTML code
<div id="1group1" class="right-item">
<div class="img-container">
<img src="" alt=""/>
</div>
<div class="description">
<div class="wrap-check"> </div>
<h3>Заголовок</h3>
<p>тра ля ля</p>
</div>
</div>
<input type="checkbox" id="1group1i" name="group1" value="">
<label for="1group1i"><a href="#1group1">Какой то заголовок</a></label>
$(".wrap-check").click(function() {
var checkBoxes = $("#1group1i");
checkBoxes.prop("checked", !checkBoxes.prop("checked"));
$(this).toggleClass("red");
});
$(".wrap-check").click(function() {
checkBoxes = $(this).closest(".right-item").attr("id")+"i";
find(checkBoxes).prop("checked", !checkBoxes.prop("checked"));
$(this).toggleClass("red");
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question