Created
November 30, 2010 00:42
-
-
Save oren/720918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
how to remove a class from the kids? | |
$('.tree > ul > li').click(function(event){ | |
$('.tree ul li').removeClass("selected"); | |
$(this).addClass("selected"); | |
$(this).find("ul > li").removeClass("selected"); | |
}); | |
<div class='tree'> | |
<ul> | |
<li class='list-with-no-kids'>company</li> | |
<li class='list-with-no-kids'>media</li> | |
<li class='list-with-no-kids'>blog</li> | |
<li class='list-with-kids'>creation | |
<ul class='hide'> | |
<li class='list-with-no-kids'>head</li> | |
<li class='list-with-no-kids'>foot</li> | |
</ul> | |
</li> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment