# tableberg/1.0.4/build/blocks/toggle/frontend.js

Tableberg – Simple Gutenberg Table Block, version 1.0.4. 1 lines.

- Page: https://pluginprobe.com/plugins/tableberg/1.0.4/code/build/blocks/toggle/frontend.js
- Raw: https://pluginprobe.com/plugins/tableberg/1.0.4/raw/build/blocks/toggle/frontend.js
- Modified: 2026-05-04T16:51:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tableberg/1.0.4/code/build/blocks/toggle/frontend.js#L10-L20`.

```javascript
document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".tab-block").forEach(l=>{const e=l.dataset.activeBackgroundColor,t=l.dataset.activeColor,o=l.dataset.backgroundColor,r=l.dataset.color,c=l.querySelectorAll(".wp-block-tableberg-toggle > .wp-block-tableberg"),a=l.querySelectorAll(".tab-heading");c.forEach(l=>{l.style.display="none"}),a.forEach((l,s)=>{l.style.setProperty("color",null!=r?r:null),l.style.setProperty("background-color",null!=o?o:null),l.classList.contains("active")&&(c[s].style.display="block",l.style.setProperty("color",null!=t?t:null),l.style.setProperty("background-color",null!=e?e:null)),l.addEventListener("click",()=>{c.forEach(l=>{l.style.display="none"}),c[s].style.display="block",a.forEach(l=>{l.classList.remove("active"),l.style.setProperty("color",null!=r?r:null),l.style.setProperty("background-color",null!=o?o:null)}),l.classList.add("active"),l.style.setProperty("color",null!=t?t:null),l.style.setProperty("background-color",null!=e?e:null)})})})});
```
