jQuery: Toggling visibility with duration

Now you see me.

Now you don't.



The jQuery Code START
    
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
          $("button").click(function() {
              $("h2").toggle(2000);
          });
      });
    </script>
    
    <style type="text/CSS">
        <!--
        .code { color: red; }
        .back { background-color: yellow; }
        .div2 { height:80px;
                width:300px;
                background-image: url(s.gif);
                background-repeat: repeat; }
        -->
   </style>
  </head>

  <body>
    <h1>jQuery: Toggling visibility with duration</h1>

    <h2>Now you see me.</h2>
    <h2 style="display: none">Now you don't.</h2>

    <button>Toggle the text</button>