jQuery .toggle() to show and hide a sub-menu
I'm trying to use show/hide on a submenu. It looks like this: Parent 1 Parent 2 Child A Child B Parent 3 Child C Child D I only want to show the submenu when I click on its parent. Currently, whenever I click on any parent, I get all of the submenus. Like so: http://jsfiddle.net/saltcod/z7Zgw/ Also, clicking on a link in the submenu toggles the menu back up. //select all the `<li>` element that are children of the `.parent` element $('.parent').children().click(function(){ //now find the `.child` elements that are direct children of the clicked `<li>` and toggle it into or out-of-view $(this)