I have a Quarto document which is rendered to HTML. In that document, I use .panel-tabset
to create tabbed panels with code examples in different languages: R and Python.
How can I create a single button that switches all the tabs on a given page?
In this minimal document, I would like the "global" button to switch all .panel-tabset
to R or Python at the same time, instead of having to click on each individual tab.
---
title: Panel tabset
---
First example:
::: {.panel-tabset}
# R
```{r}
2 + 2
```
# Python
```{python}
2 + 2
```
:::
Second example:
::: {.panel-tabset}
# R
```{r}
1 + 2
```
# Python
```{python}
1 + 2
```
:::