I have this code to showor hide a div when click on button.But... If you ckick button the div appear.. but when you click again the div doesnt dissapear:|
Code:
function infoshowhide(){
if(document.getElementById('info11').style.display = 'none')
{
document.getElementById('info11').style.display = 'block';
}
else
{
document.getElementById('info11').style.display = 'none';
}
}
and i need something like this for final result :
function infoshowhide(){
contentxinfo=document.getElementById('info') + 'x'; //x is a nr i wish to make an array... info1 ...or info2 .. info3...this thing
if(document.getElementById(contentxinfo).style.display = 'none')
{
document.getElementById(contentxinfo).style.display = 'block';
}
else
{
document.getElementById(contentxinfo).style.display = 'none';
}
};
i wish to make an array... info1 ...or info2 .. info3...this thing
can you help me :D?