Skip to content
Advertisement

Auto excluding selector resembling a toggle

I’ve being searching around and found some jQuery and Vanilla answers. I even found the exact answer to my problem, but it did not work within the rest of my code. So I have come with this adapted code which I took from this question Show / Hide Div on Click with JavaScript and it works fine but…as far as it is when I choose and option it appears, fine, but I would like that if I select the other option, then the previous turns hidden. What I mean, I need only one of the options displayed at once. This is my code:

JavaScript
JavaScript
JavaScript

Advertisement

Answer

You can set the other one to none

JavaScript

Likewise here too

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement