# \[Solved\] I need help showing and hiding an element inside a repeater

**URL:** <https://forum.wixstudio.com/t/solved-i-need-help-showing-and-hiding-an-element-inside-a-repeater/16547>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [February 23, 2019, 7:59pm UTC](https://forum.wixstudio.com/t/solved-i-need-help-showing-and-hiding-an-element-inside-a-repeater/16547 "2019-02-23T19:59:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuelmorkbednarz](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/samuelmorkbednarz/32/9372_2.png) [@samuelmorkbednarz](https://forum.wixstudio.com/u/samuelmorkbednarz)\
**Post date:** [February 23, 2019, 7:59pm UTC](https://forum.wixstudio.com/t/solved-i-need-help-showing-and-hiding-an-element-inside-a-repeater/16547/1 "2019-02-23T19:59:01Z")

</div>

Context:  
I have a box with a group of images in every instance in a repeater. I have a button in this box and I want to be able to click the button and hide the entire box in that specific repeater scope.

Problem:  
For some reason it wont hide or show the element. I can change the text of an element without changing anything else. But it wont let me hide or show elements. Is there a solution?

* * *

export function closeBtn\_click(event) {  
**const** itemClicked = event.context.itemId;

```
   $w("#blurtsRepeater").forEachItem( ($item, itemData, index) => { 
        **if** (itemData._id === itemClicked) { 
              
             $item("#panel01").hide; // <-- This line doesn't work 
             $item("#text87").text = "suck dick"; // <-- This line works 

             console.log("Success:", itemData); 
        } 
    } ); 

```

}

* * *

 ![](https://us1.discourse-cdn.com/wix/original/3X/9/9/992821b4ec5d1db21323bc1f79ce69fa772970d9.png)

#show #hide #repeater #scoped #nested

---

<div class="post-metadata">

**Author:** ![mikemoynihan99](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mikemoynihan99/32/5930_2.png) [@mikemoynihan99](https://forum.wixstudio.com/u/mikemoynihan99)\
**Post date:** [February 23, 2019, 9:21pm UTC](https://forum.wixstudio.com/t/solved-i-need-help-showing-and-hiding-an-element-inside-a-repeater/16547/2 "2019-02-23T21:21:12Z")

</div>

hide returns a promise so you must write it like this

$item(" [#panel01](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.anel01) ").hide();

---

<div class="post-metadata">

**Author:** ![samuelmorkbednarz](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/samuelmorkbednarz/32/9372_2.png) [@samuelmorkbednarz](https://forum.wixstudio.com/u/samuelmorkbednarz)\
**Post date:** [February 24, 2019, 1:31am UTC](https://forum.wixstudio.com/t/solved-i-need-help-showing-and-hiding-an-element-inside-a-repeater/16547/3 "2019-02-24T01:31:05Z")

</div>

Thank you for the reply. I tried to write it like that, but it still doesn’t work. I managed to fix it in a weird way though. Apparently it works if I write it like this:

$item(" [#panel01](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.anel01) “).hide();  
$item(” [#panel01](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.anel01) ").expand();

I have no idea why. It wont work if I only have .hide() and it wont work if I only have .expand() but if I have both, it works… Not going to question it. lol

---

<div class="post-metadata">

**Author:** ![florianhofmann1988](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@florianhofmann1988](https://forum.wixstudio.com/u/florianhofmann1988)\
**Post date:** [December 12, 2020, 4:02pm UTC](https://forum.wixstudio.com/t/solved-i-need-help-showing-and-hiding-an-element-inside-a-repeater/16547/4 "2020-12-12T16:02:05Z")

</div>

@samuelmorkbednarz thanks a lot for this hack. Great that the community works - if Wix doesn’t 😕
