# Remove Childs

**URL:** <https://forums.fusetools.com/t/remove-childs/4810>\
**Category:** How-to Discussions\
**Created:** [August 6, 2015, 2:14pm UTC](https://forums.fusetools.com/t/remove-childs/4810 "2015-08-06T14:14:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cristian\_Karmy](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cristian_karmy/32/480_2.png) [@Cristian\_Karmy](https://forums.fusetools.com/u/Cristian_Karmy)\
**Post date:** [August 6, 2015, 2:14pm UTC](https://forums.fusetools.com/t/remove-childs/4810/1 "2015-08-06T14:14:04Z")

</div>

What is the equivalent in javascript to Clear the Childrens?

In UNO I clean the children like this:

UX:

```auto
<StackPanel ux:Name="MyStackPanel">
    <Element />
    <Element />
    <Element />
    <Element />
</StackPanel>

```

UNO:

```auto
MyStackPanel.Children.Clear();

```

How can I do this in javascript?

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [August 6, 2015, 3:01pm UTC](https://forums.fusetools.com/t/remove-childs/4810/2 "2015-08-06T15:01:54Z")

</div>

JavaScript cannot directly manipulate the UI, but you can do it with observables:

```auto
var elements = Observable(1,2,3,4);

```

Make sure you include `elements` in your `module.exports`, then:

```auto
<StackPanel>
    <Each Items="{elements}">
        <Element />
    </Each>
</StackPanel>

```

Now you can add and remove from `elements` in JS.

```auto
elements.add("foo");

elements.removeAt(1);

```

---

<div class="post-metadata">

**Author:** ![Cristian\_Karmy](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cristian_karmy/32/480_2.png) [@Cristian\_Karmy](https://forums.fusetools.com/u/Cristian_Karmy)\
**Post date:** [August 6, 2015, 7:14pm UTC](https://forums.fusetools.com/t/remove-childs/4810/3 "2015-08-06T19:14:20Z")

</div>

Perfect but how can I remove all elements of “elements” if I dont know how many elements are?

I get elements from Parse and when I refresh I like to clean all the elements and replace it with the new query.

Thanks!

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [August 6, 2015, 8:16pm UTC](https://forums.fusetools.com/t/remove-childs/4810/4 "2015-08-06T20:16:38Z")

</div>

```auto
elements.clear();

```

You can find the full docs for `Observable` here:

[https://www.fusetools.com/developers/guides/fusejs/observable/members](https://www.fusetools.com/developers/guides/fusejs/observable/members)

---

<div class="post-metadata">

**Author:** ![Cristian\_Karmy](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cristian_karmy/32/480_2.png) [@Cristian\_Karmy](https://forums.fusetools.com/u/Cristian_Karmy)\
**Post date:** [August 6, 2015, 8:25pm UTC](https://forums.fusetools.com/t/remove-childs/4810/5 "2015-08-06T20:25:54Z")

</div>

Thanks! This documentation was looking for :)!
