CSS display property can be accessed using Javascript DOM style object that can be utilized to perform the collapse and expand behavior of HTML Div <div> tag. display property can get or set the value that provides the functionality to display none or show the div <div> html element. When you use the display none to hide the div element, it hides the inner text as well as div tag and releases the space blocked by the div whereas visibility property does not release the blocked space. This behavior moves the lower content below the div element to the upward direction when it releases the space while collapsing.
Basically display property belongs to the CSS styles that help to expand or collapse the <div> element on the HTML document. Javascript DOM getElementById consists of style object that can access the display property of CSS and allows to modify the value of this property.
display:. display property accepts four types of values among them only two types of values provides the functionality to hide or display the <div> element. none and block are the values that can be used to apply div collapse style
You can set none or block values dynamically using Javascript to expand or collapse the div element.
document. getElementById("id"). style. display = "none";
document. getElementById("id"). style. display = "block";
Be the first to rate this post
Tags: javascript, html, dom, html div tag, css display style, javascritp display none, css display property, html div display none, html div collapse, html div visible, dynamic html, dhtml, javascript document object, javascript getelementbyid, javascript style object
7/1/2008 2:27:50 PM
The clearest, most succinct example of using div collapse style that I have seen on the internet. Many thanks!!!
Mike
10/11/2008 3:44:59 AM