General >

Id Handling

The id of the html element which should be collapsed is used for the script code to toggle the visibility.

What happens if the element has a specified id?

Given our spec reads like this:

<div id="id" class="collapsible">This should be collapsible.</div>

When run the id is passed as parameter to the javascript function:

javascript:Collapsible.collapseExpand('id');

What happens if the element has no id?

Given our spec reads like this:

<div class="collapsible">This should be collapsible. With a generated id on the element.</div>

When run an id is generated and used as parameter to the javascript function:

<div class="toggleContainer">
    <a href="javascript:Collapsible.collapseExpand('1409716573');">Expand / Collapse</a>
    <div class="collapsible" id="1409716573" collapsed-height="1.5" collapsed-height-unit="em" style="height: 1.5em;">This should be collapsible. With a generated id on the element.</div>
</div>