JavaScript function to hide/unhide panel - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:toggle

Description

JavaScript function to hide/unhide panel

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*  www. j  ava2  s.  co  m*/
$('input[type=button]').click(function()
{
   var mypanel = $('#my');
   mypanel.toggle();
});
    });

      </script> 
 </head> 
 <body> 
  <span id="my"> Some controls </span> 
  <input type="button" value="Hide/Unhide">  
 </body>
</html>

Related Tutorials