I have a two div controls. In a condition I show the first div and hide the second div. When I hide the first div and show the second div, the second div does not change the location. How can I change the second div position to first div.
Need to show the div2 at the position of div1.
Code:
if(value===1)
{
document.getElementById("div1").style.visibility = 'hidden';
document.getElementById("div2").style.visibility = 'visible';
}
else
{
document.getElementById("div1").style.visibility = 'visible';
document.getElementById("div2").style.visibility = 'hidden';
}
Comment