I'm using this code to generate a tree in html, and the problem is, everytime I refresh the page the tree expands.
I want to create it so that when I open the page, some branches will be expanded and some collapsed, depending on an attribute it has.
For example:
<span><i class="icon-plus-sign"></i> Parent 1</span>
<ul> childrens go here
</ul>
<span><i class="icon-minus-sign"></i> Parent 2</span>
<ul> childrens go here
</ul>
When I open the page, I want to see Parent 2's children, but not Parent 1's.
I'm novice in html and completely new to css and javascript. So any suggestion would help.