Show/Hide using JQuery - A variation

Posted by Rajnilari2015 under jQuery category on | Points: 40 | Views : 246
Let say we have two hyper links Home and Search. And two buttons Home and Search.If the Cancel button is clicked, then Home link will be active. When Search button is clicked then Search link will be active.The below code will do that

<script type='text/javascript' src=''></script>
<script type="text/javascript">


$("ul#tabs li").not(".active").hide();

$("ul#tabs li").not(".active").show();

<div id="divMenuTab">
<ul id="tabs">
<li class="active"><a href="javascript:alert('test1')" id="aTabDocuments" > <span></span>Home</a></li>
<li><a href="javascript:alert('test2');" id="aTabSearch"><span></span>Search</a></li>


<div id="divSearchTab">
<input type="button" value="Cancel" id="btnSearchCancel" name="btnSearchCancel" class="btnPrimary" style="width: 60px;"/>
<input type="submit" class="btnPrimary" value="Search" id="btnSearch" name="btnSearch"/>

Comments or Responses

Login to post response