mercredi 24 mai 2023

Angular - How to use value from multiple checkboxes

How can I receive only checked values ​​in one variable?

<input type="checkbox" id="check-4" name="checkbox" value="1">
<label for="check-4"><span>1</span></label>

<input type="checkbox" id="check-4" name="checkbox" value="2">
<label for="check-4"><span>2</span></label>

<input type="checkbox" id="check-4" name="checkbox" value="3">
<label for="check-4"><span>3</span></label>

If I checked values: 1,2

let temp = [1,2]



Aucun commentaire:

Enregistrer un commentaire