Question about hiding <div> elements | Sololearn: Learn to code for FREE!


Question about hiding <div> elements

Hi guys! How can I make it possible to open only one "id" element at a time? For example: I open <div id = "a1"> Then I open <div id = "b1"> at this point <div id = "a1"> must be closed automatically. How to do this? Thank you.

9/27/2018 6:18:56 PM

Sergei Isáichenko

4 Answers

New Answer


Some ways:


You're very welcome. 🙂


Janning, Thank you so much;)


Another way to do this. Explanations in Russian, but the code in English, of course: