# Uncheck all checkboxes

**URL:** <https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087>\
**Category:** ionic-v3\
**Created:** [June 5, 2017, 5:54pm UTC](https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087 "2017-06-05T17:54:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![insightmichael](https://avatars.discourse-cdn.com/v4/letter/i/e8c25b/32.png) [@insightmichael](https://forum.ionicframework.com/u/insightmichael)\
**Post date:** [June 5, 2017, 5:54pm UTC](https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087/1 "2017-06-05T17:54:15Z")

</div>

How do I programmatically uncheck all check boxes given a certain class?

I know the ion-checkbox is rendered as a button so just setting the attribute on the element doesn’t work.

---

<div class="post-metadata">

**Author:** ![RaulGM](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/raulgm/32/144112_2.png) [@RaulGM](https://forum.ionicframework.com/u/RaulGM)\
**Post date:** [June 5, 2017, 6:15pm UTC](https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087/2 "2017-06-05T18:15:34Z")

</div>

Actually, you can do this:

```
<ion-checkbox [(ngModel)]="aBooleanVariable"></ion-checkbox>

```

Assign a boolean variable to each checkbox you have. Then, add a button and a function that, when clicked, assign a true or false value to all of your boolean variables.

---

<div class="post-metadata">

**Author:** ![insightmichael](https://avatars.discourse-cdn.com/v4/letter/i/e8c25b/32.png) [@insightmichael](https://forum.ionicframework.com/u/insightmichael)\
**Post date:** [June 6, 2017, 9:25am UTC](https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087/3 "2017-06-06T09:25:21Z")

</div>

This seems to check or uncheck all of them and not allow individual checking.

---

<div class="post-metadata">

**Author:** ![RaulGM](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/raulgm/32/144112_2.png) [@RaulGM](https://forum.ionicframework.com/u/RaulGM)\
**Post date:** [June 6, 2017, 2:21pm UTC](https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087/4 "2017-06-06T14:21:56Z")

</div>

You have to assign different variables for each checkbox. Like aBooleanVariable1, aBooleanVariable2, aBooleanVariable3, etc.

---

<div class="post-metadata">

**Author:** ![Fayme](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@Fayme](https://forum.ionicframework.com/u/Fayme)\
**Post date:** [March 11, 2019, 1:57pm UTC](https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087/5 "2019-03-11T13:57:50Z")

</div>

How to assign different variable to each checkbox when my list of checkbox is dynamic?! There must be other way around.

---

<div class="post-metadata">

**Author:** ![RaulGM](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/raulgm/32/144112_2.png) [@RaulGM](https://forum.ionicframework.com/u/RaulGM)\
**Post date:** [March 11, 2019, 2:12pm UTC](https://forum.ionicframework.com/t/uncheck-all-checkboxes/93087/6 "2019-03-11T14:12:59Z")

</div>

I imagine that you have an array of objects. ngFor those checkboxes and set the value as the property you want to show.
