Rajneesh Chaubey

Rajneesh Chaubey

  • NA
  • 2.9k
  • 223.6k

How to hide and show div using jquery?

Jan 15 2018 12:56 PM
Hi, I have two buttons on aspx page named 'show employee' and 'show customers' and I have two gridviews on my page. 
Here is the code:-
  1. <form id="form1" runat="server">  
  2.    <div id="grdemployee">  
  3.    <asp:GridView ID="GridView1" runat="server">  
  4.    </asp:GridView>  
  5.    </div>  
  6.   
  7.      
  8.    <div id="grdcustomer">  
  9.    <asp:GridView ID="GridView2" runat="server">  
  10.    </asp:GridView>  
  11.    </div>  
  12.   
  13.   
  14.   
  15.     <asp:Button ID="btnemployee" runat="server" Text="Show Employee" />  
  16.     <asp:Button ID="btncustomer" runat="server" Text="Show Customer" />  
  17.     </form>  
How do I create jquery code such that when I click show employee button , the employee gridview gets visible and If I click show customer button ,customer gridview should be visible and employee grdview got hide and vice versa.
suppose employee gridview is present and then I click show customer then it should hide employee grvw and make customer gridview visible. 

Answers (1)