jQuery newbie needs help - target only one li and its children?

Hi,

I am making a menu, and you can see what I have made so far in this fiddle

What I want to do is make it so that when I click the first <li> only the sub-menu for this <li> will show, and if I click another <li> I want this one the current one to close and show the new one. Atm clicking another wont close the previous.

Point me in the right direction?=)

Try defining a global variable which stores the active li? Then when one is clicked, check that the global variable has a value, if it does, then hide the li and set the global variable to the new li.

The value should be that of the li that is clicked. I hope this makes sense XP

Okey, could you show me how this could look? I am very new to jQuery, but trying to learn.

http://jsfiddle.net/LGRaB/30/

That is the same one as my fiddle above, did you maybe link the wrong one?=)