the above is not cross-browser friendly though, as different browsers require different values to be set to the visibility.

however comma though......

you can change the display of the object:
document.getElementById('text1').style.display="none"; //for hide
document.getElementById('text1').style.display="block"; //for show

there is a difference in the two ways. changing the objects visibility does just that, it still takes up the space it would if it were visible. where changing the display of an object hides it and all other objects around it fill in the space.