# SOLVED: Broken JS in Shortcode in Tabs (Nestable)

**URL:** <https://forum.bricksbuilder.io/t/solved-broken-js-in-shortcode-in-tabs-nestable/28235>\
**Category:** Bugs\
**Tags:** v1-11-1-1\
**Created:** [November 25, 2024, 10:45pm UTC](https://forum.bricksbuilder.io/t/solved-broken-js-in-shortcode-in-tabs-nestable/28235 "2024-11-25T22:45:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johannesglaser](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/johannesglaser/32/29375_2.png) [@johannesglaser](https://forum.bricksbuilder.io/u/johannesglaser)\
**Post date:** [November 25, 2024, 10:45pm UTC](https://forum.bricksbuilder.io/t/solved-broken-js-in-shortcode-in-tabs-nestable/28235/1 "2024-11-25T22:45:07Z")

</div>

**Browser** : Chrome  
**OS** : macOS  
**Video** : [https://imgur.com/a/bricks-bug-1-11-1-1-broken-js-shortcode-tabs-nestable-TJW4XIh](https://imgur.com/a/bricks-bug-1-11-1-1-broken-js-shortcode-tabs-nestable-TJW4XIh)

 ![Bildschirmfoto 2024-11-25 um 23.36.06](https://forum.bricksbuilder.io/uploads/default/original/3X/6/e/6ec147fd2c446a30c28bc4e8326c75dcfde90f91.png)

When using a somewhat weird combination of a shortcode with a Tabs (Nestable) element, JavaScript code inside the shortcode breaks.

## Preparation

1. Add this code to your functions.php or anywhere else

```auto
add_shortcode("broken_shortcode", function ($args) {
    return "<script>\n" . 
    " // This script is broken\n" . 
    " // </div>\n" . 
    "</script>\n";
});

```

1. Add this shortcode inside a “Tabs (Nestable) \> Shortcode” Bricks-element: `[broken_shortcode]`

## Expected output

```auto
<script>
    // This script is broken
    // </div>
</script>

```

## Actual output

```auto
<script>
    // This script is broken
    // </script></div>

```

As you can see, the Closing Script tag moved to the wrong place, breaking the whole page.

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [November 26, 2024, 9:57am UTC](https://forum.bricksbuilder.io/t/solved-broken-js-in-shortcode-in-tabs-nestable/28235/2 "2024-11-26T09:57:31Z")

</div>

Hi @johannesglaser,

yeah, I can replicate this. I’ve added it to the internal bug tracker, and will update this topic once we fix this issue.

For now, you will have to avoid using broken scripts in the nestable tabs. 🙂

Thanks,  
Matej

---

<div class="post-metadata">

**Author:** ![bricks.assistant](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/bricks.assistant/32/32537_2.png) [@bricks.assistant](https://forum.bricksbuilder.io/u/bricks.assistant)\
**Post date:** [September 28, 2026, 10:27am UTC](https://forum.bricksbuilder.io/t/solved-broken-js-in-shortcode-in-tabs-nestable/28235/3 "2026-09-28T10:27:25Z")

</div>

We’ve addressed this in Bricks 2.4.2, now available as a one-click update in your WordPress Dashboard.

JavaScript inside a Shortcode element in Nestable Tabs is now preserved during Tabs rendering.

Please read the [changelog entry](https://bricksbuilder.io/release/bricks-2-4-2/) before updating, and let us know if you experience any issues.
