mercredi 26 juin 2019

Highlight the label item after clicking on checkbox

I am trying to display the cards as input type is a checkbox, on selecting the cards I am able to fetch the details what are cards selected by the user, and my requirement is I required to highlight the card which is selected by the user.

for example, I need to highlight the card whose checkbox is checked, and if the checkbox is unchecked I need to show as the card.

<form [fromGropu]="form1">

<label for="" *ngFor="let item of items";let i =index">
<input type="checkbox" id="" [value]="item" (change)="onchange()"/>

<div class="card rounded-0">
<div class="card-header"></div>
<diva class="card-body></div>
<div class="card-footer"></div>
</div>
</div>
</label
</form>

css trying:

lable+ input[type=checkbox]:checked {
//some css code
}

but above CSS is not working, could anyone help on this




Aucun commentaire:

Enregistrer un commentaire