0

Thanks a lot for all replys

# You realy helped :D #

But i have one more question :))

function infoshowhide(id) {
    var e = document.getElementById(id);
    if (e.style.display == 'block')
        e.style.display = 'none';
    else
        e.style.display = 'block';
}

i wish to make something like that:

 function infoshowhide(id) {
    var e = document.getElementById(id) + X; //x is not a var... just x... :D
    if (e.style.display == 'block')
        e.style.display = 'none';
    else
        e.style.display = 'block';
}

how is corecct code for an array.. unite e with x :

Example:

e = info11
I need to change style for element with id info11x so i just need to add x to may variable..
How can i do this :D?

0

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?