# Container children (removeInteractive?)

**URL:** <https://phaser.discourse.group/t/container-children-removeinteractive/4820>\
**Category:** Phaser 3\
**Created:** [January 8, 2020, 3:04pm UTC](https://phaser.discourse.group/t/container-children-removeinteractive/4820 "2020-01-08T15:04:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casey](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/casey/32/2503_2.png) [@casey](https://phaser.discourse.group/u/casey)\
**Post date:** [January 8, 2020, 3:04pm UTC](https://phaser.discourse.group/t/container-children-removeinteractive/4820/1 "2020-01-08T15:04:32Z")

</div>

I have a container set to interactive.  
I’ve then added several sprites via a _for_ statement. Each sprite is set to interactive individually (they do different things).

I then want to make each sprite uninteractive (removeInteractive) all at once. If I set the container to not interactive, it doesn’t work–each sprite remains interactive. I assume I need to access each child in the container and use a removeInteractive statement.  
I’ve tried a forEach statement but that doesn’t work.  
How do I access children of a container? thanks

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 8, 2020, 4:26pm UTC](https://phaser.discourse.group/t/container-children-removeinteractive/4820/2 "2020-01-08T16:26:11Z")

</div>

[each()](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Container.html#each), [getAll()](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Container.html#getAll), [iterate()](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Container.html#iterate)

---

<div class="post-metadata">

**Author:** ![casey](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/casey/32/2503_2.png) [@casey](https://phaser.discourse.group/u/casey)\
**Post date:** [January 8, 2020, 4:33pm UTC](https://phaser.discourse.group/t/container-children-removeinteractive/4820/3 "2020-01-08T16:33:54Z")

</div>

Thank you–but I’m still unclear.  
containername.each(child).removeInteractive?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 8, 2020, 5:45pm UTC](https://phaser.discourse.group/t/container-children-removeinteractive/4820/4 "2020-01-08T17:45:06Z")

</div>

```javascript
container.each(function (child) {
  child.removeInteractive();
});

```
