Link to home
Start Free TrialLog in
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

ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yingwho
yingwho

ASKER

thanks