I have 3 checkbox
- On click of "A" checkbox the A has to be highlighted.
- On click of "C" checkbox the "C" gets highlighted.
- On click of "B" checkbox the "A" and "B" has to be highlighted.
.a {
background-color: #ffffff;
font-family: Lato;
font-size: 11.2px;
font-weight: 500;
text-align: center;
color: #6a7c94;
padding: 2px;
width: 100px;
height: 34.2px;
margin-bottom: 15px;
box-shadow: 0 2px 7px 0 rgba(0, 0, 0, 0.15);
}
#checkboxes input[type=checkbox] {
display: none;
}
#checkboxes input[type=checkbox]:checked+.a {
border-top: 2px solid #39cd90;
color: rgb(57, 205, 144);
padding-top: 0px;
}
<div id="checkboxes">
<input type="checkbox" name="rGroup" id="r1" />
<label class="a" for="r1">A </label>
<input type="checkbox" name="rGroup" id="r2" />
<label class="a" for="r2">B </label>
<input type="checkbox" name="rGroup" id="r3" />
<label class="a" for="r3">C</label>
</div>
On click of "B" how to get highlighted both "A" and "B" as multiple selection. Here is my complete code How to achieve this give some suggestions.