style.visibility (Property)

The visibility of elements in this style.


CSS level - 2
DOM level - 2
JavaScript - 1.2
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Opera - 5.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.visibility = aSwitch
CSS syntax:visibility: aSwitch
Argument list:aSwitchA visibility switch value

This controls the visibility of a DOM or HTML Element object. It corresponds to the visibility property of the Netscape Navigator Layer object but uses different keywords.

The following keywords are appropriate for use with this property:

The inherit keyword allows a child element to be visible only when its parent is visible.

If the child element is made explicitly visible or hidden then its visibility will be unaffected by its parent element object. The parent can be invisible, possibly being used for positioning control while the child is on display.

The hide and show keywords are considered Netscape Navigator 4 and are deprecated. Since hidden and visible work even for layers, there is no need to ever use hide and show.

The hidden and visible keywords mean the same thing as hide and show but are more portable across browsers and the CSS standard.

See also:Layer.visibility