every li element has a anchor tag next to it (not shown in the code, please assume that).
Now if a select value "Child" from the above code then i should get the below result "Grand Parent/ Parent / Child" and if i select parent then i should get "Grand Parent / Parent"
So basically the i want to get parent with all its child
Here is my code: