The display property of an object’s style (set it to “none”) is often better for this kind of thing because it removes it from rendering entirely, thus avoiding potential layout collisions and problems like the one you get above because of the <pre> tags.
[close]
Permanent link · http://querylog.com/q/JAVASCRIPT+VISIBILITY+collapse+example