Question : show and hide multiple divs using onclick

I have three divs on my page. I have a drop down menu with three options. Based on which option they select I need the div to show. If they choose another select option i need the current div to hide but show the next one that was selected..thanks

Answer : show and hide multiple divs using onclick

Hi,

Very simple.

Let's assume that you just want to show the div1 and not div2 and div3. Similarly for the rest of the scenarios.

                document.getElementById("div1").style.display = 'block';
                document.getElementById("div2").style.display = 'none';
                document.getElementById("div3").style.display = 'none';

Thanks
David
Random Solutions  
 
programming4us programming4us