# Unable to show hidden text on repeater

**URL:** <https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [April 21, 2021, 4:22pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671 "2021-04-21T16:22:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![equebal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/equebal/32/27452_2.png) [@equebal](https://forum.wixstudio.com/u/equebal)\
**Post date:** [April 21, 2021, 4:22pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/1 "2021-04-21T16:22:15Z")

</div>

I am using below code to show / highlight an item on repeater. It’s a quiz page and explanation should be visible using below line once user click on “Show Answer” button. This is working fine in Preview mode however not working after publishing the site. I tried with box element as well and that’s also having same issue.

You can see the live page [here](https://www.techuisitive.com/quizv2) . The explanation should be visible below “Show Answer” button.

Line number 5:

```javascript
$item("#textanswer").show(); //this is working in preview mode only

```

Other code with in Switch statement is working fine in both preview and live mode.

```javascript

export function buttonshowanswer_click(event) {

 const itemClicked = event.context.itemId;

     $w("#repeater1").forEachItem( ($item, itemData, index) => {
 if (itemData._id === itemClicked) {
 
               $item("#textanswer").show(); //This line does not work
 
 let choice = ($item("#textcorrectchoice").text)
 // console.log(choice)

 switch (choice) {
 case "A":
                         $item('#boxA').style.backgroundColor = "rgba(0,255,0,0.5)"
 break;
 case "B":
                         $item('#boxB').style.backgroundColor = "rgba(0,255,0,0.5)"
 break;
 case "C":
                         $item('#boxC').style.backgroundColor = "rgba(0,255,0,0.5)"
 break;
 case "D":
                         $item('#boxD').style.backgroundColor = "rgba(0,255,0,0.5)"
 break;
 default:
 break;
                    }

        }
     });
}

```

---

<div class="post-metadata">

**Author:** ![equebal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/equebal/32/27452_2.png) [@equebal](https://forum.wixstudio.com/u/equebal)\
**Post date:** [May 1, 2021, 8:10pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/2 "2021-05-01T20:10:56Z")

</div>

The issue was fixed by Wix support. They informed there was an issue how codes are rendered in live site. However, I started facing similar issue again after making some changes in the site. Again the code is working fine in Preview however it’s not working as expected in live site. Please note that it was working fine till few hours back. This seems to be an issue at Wix which should be rectified on priority.

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [May 1, 2021, 8:43pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/3 "2021-05-01T20:43:27Z")

</div>

The following code must be **inside** the **$w.onReady(){}** block.

```javascript
$w("#dataset1").onReady(function () {
	   // $w("#dropdown1").selectedIndex = 1
        // $w("#repeater1").show();
        // console.log("Dataset1 On ready - dataset1 ready")
		
});

```

Currently it’s outside.  
So either move it to the $w.onReady block or delete it completely.

---

<div class="post-metadata">

**Author:** ![equebal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/equebal/32/27452_2.png) [@equebal](https://forum.wixstudio.com/u/equebal)\
**Post date:** [May 1, 2021, 8:55pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/4 "2021-05-01T20:55:33Z")

</div>

@jonatandor35 The code you mentioned are disabled. The same line already added in $w.onready function.

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [May 1, 2021, 9:10pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/5 "2021-05-01T21:10:14Z")

</div>

@equebal you’re still having it outside the $w.onReady() and this is an error that kills your code.

---

<div class="post-metadata">

**Author:** ![equebal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/equebal/32/27452_2.png) [@equebal](https://forum.wixstudio.com/u/equebal)\
**Post date:** [May 1, 2021, 9:13pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/6 "2021-05-01T21:13:26Z")

</div>

Thanks. I will remove this and check again.

---

<div class="post-metadata">

**Author:** ![equebal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/equebal/32/27452_2.png) [@equebal](https://forum.wixstudio.com/u/equebal)\
**Post date:** [May 1, 2021, 9:14pm UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/7 "2021-05-01T21:14:51Z")

</div>

@jonatandor35 Thanks. I will remove this and check again.

---

<div class="post-metadata">

**Author:** ![equebal](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/equebal/32/27452_2.png) [@equebal](https://forum.wixstudio.com/u/equebal)\
**Post date:** [May 2, 2021, 11:54am UTC](https://forum.wixstudio.com/t/unable-to-show-hidden-text-on-repeater/2671/8 "2021-05-02T11:54:36Z")

</div>

@jonatandor35 I updated the code as per your advise and it’s working fine now. Thanks for your help.
