javascripthtmlvisibility

How to make a DIV visible and invisible with JavaScript?


Can you do something like

function showDiv()
{
    [DIV].visible = true;
    //or something
}

Solution

  • if [DIV] is an element then

    [DIV].style.visibility='visible'
    

    OR

    [DIV].style.visibility='hidden'