<script type='text/javascript' src='http://code.jquery.com/jquery-1.4.4.min.js'></script>
<div id="navcontainer">
<ul id="navlist">
<li><a href="#">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>
<script type='text/javascript'>
$(document).ready(function(){
$('#navlist li').click(function(){
$('#navlist li').hide();
$(this).show();
});
});
</script>
This hides li except clicked one. How to show all li again when clicked on visible li?
If item one is clicked, only item one is visible and other li are hidden. How to show hidden li if item one ($(this).show( );) clicked again