0
<div id="navcontainer">
 <ul id="navlist">
   <li><a href="#" id="current">Item one</a></li>
   <li><a href="#">Item two</a></li>
   <li><a href="#">Item three</a></li>
   <li><a href="#">Item four</a></li>
   <li><a href="#">Item five</a></li>
 </ul>
</div>

This is my code for menus. How to hide "Item two, three, four, five", If "Item one" is clicked (using jquery)?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by stbuchok
0

Haven't tested it, but it should work.

$('#navlist li').click(function(){
    $('#navlist li').hide();

    $(this).show();
});
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.