i have 4 different divs in german. By clicking a button, i want to hide the german divs and instead show the english divs, which are hidden before.
There are ways to change between 2 divs, but how can i change mulitple divs at the same time by clicking one time on one button?
Are you restricted to not use a framework like jQuery? jQuery offers multiple methods to run your code on more than one selected elements.
Here is a basic working solution in pure javascript for you:
Link to jsfiddle: https://jsfiddle.net/v2k3rzge/
Hope it helps
You'll need JavaScript
or for an easier approach a JavaScript library like jQuery.
The basic approach is to add data-* attributes and classes to your elements:
than your jQuery might look like:
Here's a live jsBin example you can play with or even download