07.20.08
Change the visibility of a html element
I often use this code to toggle the visibility of a HTML element on the page. It is especially useful with forms and showing different option depending on what the user selects. Here is the code:-
function ToggleVis(element){ var Target=document.getElementById(element); if(Target.style.display==""){ Target.style.display="none"; }else{ Target.style.display=""; } }