I have menu which is highlighted when a particular menu item is selected.
Now the problem comes when there are child items in the menu. I want to select the parent item and the child item of the menu.
Can anyone help me out.

Below is the html and javascript i use for highlighting the menu.

```
 <ul class="sidebar-menu">
        <li class="header">MENU OPTIONS</li>

       <li><a onclick="getView(this,"menu","title");" title="First" menu="First" url="Folder/First" href="#"><i class="fa fa-book"></i><span>First Page</span></a></li>

       <li><a onclick="getView(this,"menu","title");" title="Second" menu="Second" url="Folder/Second" href="#"><i class="fa fa-bell"></i><span>Second Page</span></a></li>

      <li class="treeview active"><a href="#"><i class="fa fa-edit"></i><span>Third Page</span><i class="fa fa-angle-left pull-right"></i></a>

<ul class="treeview-menu menu-open" style="display: block;">
    <li><a onclick="getView(this,"menu","title");" title="Child 1" menu="Child 1" url="Folder/Page" href="#"><i class="fa fa-circle-o"></i>First Child</a>
    </li>
    <li><a onclick="getView(this,"menu","title");" title="Child 2" menu="Child 2" url="Folder/Page" href="#"><i class="fa fa-circle-o"></i>Second Child</a>
    </li>

    </ul></li>

        </ul>

```

The javascript code:

```
 $(document).ready(function () {
if (localStorage.menu !== undefined) {
    $('.sidebar-menu>li').removeClass('selectedMenu');
    $(".sidebar-menu>li>a[menu='" + localStorage.menu + "']").parent().addClass('selectedMenu');
}
else {
    $(".sidebar-menu>li>a[menu='Home']").parent().addClass('selectedMenu');
}

```