java script collapsible

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
shragiAsked:
Who is Participating?
 
MrunalCommented:
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/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.