Toggle table using javascript

I want to change the table's hidden value to true when the navigation is clicked, but the JavaScript doesn't work properly. Can I get some advice on this?

I want the hidden value of the blue table attribute to change when the red color is clicked.

What you want to do is the following:

  1. Create a temporary state variable -> tableVisible
  2. Initialize the value for that variable to -> true
  3. In the table hidden property field add:
{{ tableVisible.value }}
  1. Create a JS Query -> toggleTable
  2. in that JS Query add the following code:
tableVisible.setValue( !tableVisible.value )
  1. Now in your button just call the toggleTable JS Query and you will show/hide the table

Thank you for your kind explanation.
Thanks to you, we can resolve the issue and continue configuring our website.

1 Like

Perfect! Glad to help.