I have a number of elements, only one of which should be visible at any time. The users can click to make different ones visible.
The code basically does this:
Expand|Select|Wrap|Line Numbers
- function(x) {
- document.getElementById('element1').style.visibility = 'hidden';
- document.getElementById('element2').style.visibility = 'hidden';
- document.getElementById('element3').style.visibility = 'hidden';
- document.getElementById(x).style.visibility = 'visible';
- }
However the last line seems to be ignored. If I try and set visible and hidden in the same piece of code it seems that hidden just overrides. Is there any way around this?