Loading ...

Hide and show controls using jquery

 /5
0 (0votes)

Here is code snippet :-
<script type="text/javascript">
    $(document).ready(function() {
     $(
'#box').hide();

     $(
'a#show').click(function() {
     $(
'#box').show('slow');return false;
     });

     $(
'a#hide').click(function() {
      $(
'#box').hide('slow');
       return false;
      });
});
</script>

Html code -
<a href="#" id="show">Show the text box</a>
<
div id="box">
<
a href="#" id="hide">Hide the text box</a>
<
input id="txt" value="This is the box that will be shown and hidden"
type="text" style="border-style:solid;height:20px;width:350px; font-weight:bold"/></div>

hope this will help you. thanks

 

 

Comments (1)

   
Anonymous
Anonymous
this helpme alot thanks duded
10/14/2009
 · 
by
  • :*
  • :*
  • :
 *

Top Posts