Avatar of yingwho
yingwho
 asked on

visibilty jquery

i am trying to hide all the li items that do not have class "new".
but at the same time need to show the li items that are on the same tree, that is i need to show the li item "4444444".
i get object error. pl suggest.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
 <script src="http://code.jquery.com/jquery-latest.js"></script>
 <script>
$(document).ready(function() {
	$('.mylist .branch1 li:not(.new)').hide();
	$('.mylist li.new li').siblings.show();
});
</script>
 </head>
 <body>
  <div class="mylist">
	<ul class="tree1">
		<li class="branch1">fasdff
			<ul>
				<li>11111111111</li>
				<li>22222222222</li>
			</ul>
		</li>
		<li class="branch1">enewnwew
			<ul>
				<li class="new">33333333333</li>
				<li>44444444444</li>
			</ul>		
		</li>
	</ul>
  </div>
 </body>
</html>

Open in new window

jQuery

Avatar of undefined
Last Comment
yingwho

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
amit_g

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Terry_focus

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
yingwho

ASKER
thanks
yingwho

ASKER
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck