Monday, July 1, 2013

Show Hide div using JQuery in asp .net

==>> In this article I am posting how to show and hide div using JQuery. Some time we need to hide and show div for show hide information on page so this post will heplfull for you.



.ASPX Code.



<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">


  
   <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
  
   <script type="text/javascript" language="javascript">

       $(document).ready(function() {

           $("#show").click(function() {
               $(".mydiv").show(1000);

           });
           $("#hide").click(function() {

               $(".mydiv").hide(1000);

           });

       });
  
  
   </script>

    <title>Show-Hide div using JQuery</title>
   
    <style type="text/css">
    .mydiv
    {
        margin:10px;padding:12px;
      border:2px solid #666;
      width:100px;
      height:100px;
       
       
        }
   
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div  class="mydiv">
This is test div  
    </div>
   
    <input id="show" type="button" value="Show" />
    <input id="hide" type="button" value="Hide" />
    </form>
</body>
</html>


DEMO:-



Show-Hide div using JQuery
Show Hide test div

No comments:

Post a Comment