We help IT Professionals succeed at work.

java script collapsible

shragi
shragi asked
on
Hi - I wrote the following php code and now I want to add collapsible function to this.
I am not sure how to add it.

when I run the attached php program (ee.txt) the output will be something like this.

Customer Oriented
   Another Process
   process 1

Support
    4th process
    3rd Process

Management
     Control of Documents
     Sales
     some process


but I want all this to be collapsible because the number of processes may be more...
so i want output like below
+Customer Oriented
+Support
+Management
when i click on + i want to see the list.

How can change the attached php to do that.
generally in html I use data-role="collapsible"
but here when i used i got errors.

Thanks
ee.txt
expertexchange.PNG
Comment
Watch Question

hi
In simple way thinking you can write css class and add class when page is getting loaded and on click (+) sign you can toggle it.

Check this out:

https://jsfiddle.net/qw5c8qL8/1/