Looking to add a tree menu for this example. Initially all sections should be collapsed. Upon clicking on "Facility," the Buildings should expand in a tree-like format, and further clicks on XYZ building should reveal the Floors. Something along those lines...
Tried using this code, but it's not functioning as expected. Any assistance would be greatly appreciated.
$('.treemenu').click(function () {
$(this).parent().children('ul.subtree');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<ul class="treemenu">
<li>Facility
<ul class="subtree">
<li>Building
<ul class="subtree">
<li>Royal Building</li>
<li>Taj Building</li>
<li>XYZ Building
<ul class="subtree">
<li>Floors
<ul class="subtree">
<li>1st Floor</li>
<li>2nd Floor</li>
<li>3rd Floor</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>