# Chatbox Not A Valid Selector

**URL:** <https://forum.wixstudio.com/t/chatbox-not-a-valid-selector/8556>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [December 24, 2020, 8:19pm UTC](https://forum.wixstudio.com/t/chatbox-not-a-valid-selector/8556 "2020-12-24T20:19:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas78625](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/thomas78625/32/25677_2.png) [@thomas78625](https://forum.wixstudio.com/u/thomas78625)\
**Post date:** [December 24, 2020, 8:19pm UTC](https://forum.wixstudio.com/t/chatbox-not-a-valid-selector/8556/1 "2020-12-24T20:19:38Z")

</div>

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

```javascript
export function button3_click(event)
{
 if($w("#LiveChat").maximized) 

    {
        $w("#LiveChat").minimize();
    }
 else
    {
        $w("#LiveChat").maximize();
    }
}

```

Hello, I am getting the error: ‘#LiveChat’ is not a valid selector.  
The code isn’t working in preview mode or on the live site.  
All of the ID’s match up. What am I doing wrong here?  
The code is located on the homepage as that is where the button is located.  
I would like button3 to be clicked and open up the LiveChat.

---

<div class="post-metadata">

**Author:** ![valentin\_wackermedia](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/valentin_wackermedia/32/81083_2.png) [@valentin\_wackermedia](https://forum.wixstudio.com/u/valentin_wackermedia)\
**Post date:** [November 13, 2023, 9:54am UTC](https://forum.wixstudio.com/t/chatbox-not-a-valid-selector/8556/2 "2023-11-13T09:54:14Z")

</div>

Hi Thomas

This answer is a little late I guess, but maybe it helps some other people: If you want to select the Wix Chat Element in Wix Velo you have to do this in the “masterPage.js”, since it is a global element.
