Toggle

Show hide things

by cmoreira

HTML

<a href="#" onclick="showform('usmap')">Show Form US</a>
<a href="#" onclick="showform('inmap')">Show Form IN</a>
<div id="usmap" style="display:none">THIS IS THE FORM for US</div>
<div id="inmap" style="display:none">THIS IS THE FORM for IN</div>

JavaScript

function showform(map) {
    
    var divs=["usmap","inmap"];

    for (var i=0;i<divs.length;i++)
    {
        document.getElementById(divs[i]).style.display='none';
    }
    
    document.getElementById(map).style.display='block';

}