Hello,
I am using javascript to show/hide nested lists. I modified some code originally posted by ACoder on an earlier thread. Currently, however, the page loads with everything showing. My goal is the reverse: the page should load with everything hidden, and only by activating the script will more items be revealed. So, the default would look like this:
Default:
ITEM 1 Click to show more
---
After click:
ITEM 1 Click to show less
Here is my current javascript code:
[CODE=javascript]function showhideexample s(anchor) {
var span = document.getEle mentById('subit em1');
span.style.disp lay = (span.style.dis play=='block')? 'none':'block';
anchor.innherHT ML = (anchor.innherH TML=='Show Examples')?'Hid e Examples':'Show Examples';
}
[/CODE]
Thanks!
I am using javascript to show/hide nested lists. I modified some code originally posted by ACoder on an earlier thread. Currently, however, the page loads with everything showing. My goal is the reverse: the page should load with everything hidden, and only by activating the script will more items be revealed. So, the default would look like this:
Default:
ITEM 1 Click to show more
---
After click:
ITEM 1 Click to show less
Sub Item
Here is my current javascript code:
[CODE=javascript]function showhideexample s(anchor) {
var span = document.getEle mentById('subit em1');
span.style.disp lay = (span.style.dis play=='block')? 'none':'block';
anchor.innherHT ML = (anchor.innherH TML=='Show Examples')?'Hid e Examples':'Show Examples';
}
[/CODE]
Thanks!
Comment