The "<div..." Expand/Collapse control function

Have you ever created a web page that had so much information on it that some of the key information seems to get lost in all the detail?

This web page displays information about how to implement a single function that will allow you to list key information and hide the details. The function provides your users the option to expand individual detail sections, and the function handles hiding all the other detail sections. If your user understands the key information they probably do not need the details. However, you can provide the details.

(click on the "+" signs to expand each division)

First define a group; + Show group details.

Second define your sections; + Show section details.

Third define the elements of each section; + Show details for the elements.

Close your sections and group: + Show closing detail.

Other information: + Show additional detail.

I tried to keep this function as simple as possible, so that it could be inserted into nearly any web page. It can be used inside forms, frames, and tables. As far as I know you can put just about anything inside the collapsible division, including another expand/collapse group.

The function depends on the relative position of the elements inside each section. This eliminates the necessity for a specific naming convention for the elements, sections, and groups.

Valid XHTML 1.0 Transitional