Not opening childs

I'm trying to create a simple menu structure which will open the child li items. I seem to be able to get the first branch working, however I cant get it working on lower branches.

I thought I could just just use the following:-
    $(document).on("click", "li", function (e) {
        $(this).find('ul').toggle();
        $(this).find('ul ul').css("display", "none");
        e.preventDefault();
    });

Open in new window


Ive put it on jsFiddle http://jsfiddle.net/fxhg86d6/ in the hope someone can assist. As you can see you can click on 'Tickets' and you should be able to click on 'New Ticket' which should open another branch, but it doesnt :-S

Any suggestions on how I can fix my code?

Thanks in advance
tonelm54Asked:
Who is Participating?
 
tonelm54Author Commented:
Figured it out:-
    $(document).on("click", "li", function (e) {
        $(this).children().toggle();
        //$(this).find('ul ul').css("display", "none");
        e.preventDefault();
        e.stopPropagation();
    });

Open in new window

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.