# Video Gallery: How to open specific platform tab by default

**URL:** <https://community.elfsight.com/t/video-gallery-how-to-open-specific-platform-tab-by-default/173466>\
**Category:** Pro Tips\
**Tags:** video-gallery\
**Created:** [September 13, 2026, 9:00pm UTC](https://community.elfsight.com/t/video-gallery-how-to-open-specific-platform-tab-by-default/173466 "2026-09-13T21:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [September 13, 2026, 9:00pm UTC](https://community.elfsight.com/t/video-gallery-how-to-open-specific-platform-tab-by-default/173466/1 "2026-09-13T21:00:00Z")

</div>

Looking for a way to pre-select a certain category in your [Video Gallery](https://elfsight.com/video-gallery-widget/) widget? We’ve got a simple solution!

```auto
const ACTIVE_TAB = 2;

util.waitForElement(`.es-tabs-slider-item:nth-child(${ACTIVE_TAB}) .es-tab-item-container`).then(tab => tab.click());

```

  

Replace `2` in the 1st line of the code with the number of the tab you want to pre-select and add the resulted code to the **Custom JS** field on the **Settings** tab of your widget’s settings.

> **Note:** Custom JS doesn’t function in the preview mode, so you can check the result right on your website or through the [Share Link](https://help.elfsight.com/article/1471-how-to-share-widget-via-link)

  

### Guys, was this solution helpful to you? Share your experience in the comments below 👇
