Controlling Element Visibility

The visibility property controls the visibility of elements.

The allowed values for the visibility property:

collapseThe element isn't visible and doesn't occupy space.
hiddenThe element isn't visible, but it still occupies space.
visibleThe element is visible on the page(default value).

The collapse value is only applicable to table-related elements, such as tr and td.

        <style type="text/css"> 
        tr > th { text-align:left; background:gray; color:white} 
        tr > th:only-of-type {text-align:right; background: lightgray; color:gray} 
            <tr id="firstchoice"> 
            var buttons = document.getElementsByTagName("BUTTON"); 
            for (var i = 0; i < buttons.length; i++) { 
                buttons[i].onclick = function(e) { 
                    document.getElementById("firstchoice").style.visibility = 
Click to view the demo
  HTML CSS Book