Amazingly, there are different non-equivalent ways to show and hide elements. Lean/try them all to decide which way you want.
element.style.visibility="hidden"
element.style.visibility="collapse"
element.style.visibility="visible"
See
http://www.w3schools.com/cssref/pr_class_visibility.asp[
^].
Another way is using the CSS
display
style 'none' or 'block':
element.style.display="none"
element.style.display="block"
One more way, slightly different from the first one:
function hide(object) { object.style.visibility = "hidden"; }
function show(object) { object.style.visibility = null; }
This is jQuery way:
.hide() | jQuery API Documentation[
^],
.show() | jQuery API Documentation[
^].
In addition to this pure client-side stuff, you can have additional method related to postback to the server side. As server side just generates HTML content in HTTP response, you can not only hide or show the HTML element, but… simply skip it depending on some condition.
—SA