[php]$items = array('item 1'=>array('sub_item_1', 'sub_item_2', 'sub_item_3'),
'item 2'=>array('sub_item_1', 'sub_item_2'),
'item 3'=>array('sub_item_1', 'sub_item_2', 'sub_item_3'));[/php]
This information is stored in a session. Now I wish to display this information in a long list, but I don't want the list to all be viewable at the same time. It should start out looking like this...
item1 [View]
item2 [View]
item3 [View]
...and when you click view next to an item it should change to this...
item1 [View]
item2 [Hide]
- sub_item_1
- sub_item_2
item3 [View]
I assume the simplest solution will be to load all of the information into a JavaScript array and use JavaScript to manipulate the HTML to add an remove elements. Problem is I haven't got the faintest idea how to start as I know pretty much nothing about JavaScript.
Any suggestions?
