Valid XHTML 1.0 Transitional

Slide paragraphs up and down

This is paragraph 1.

This is paragraph 2.

This is paragraph 3.

This is paragraph 4.

The jQuery codeCode START
    
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script><!-- restore this js 032611 -->
    <script type="text/javascript">

      function slideup() {
        $('#first').slideUp("slow");
      }
      function slidedown() {
        $('#first').slideDown("slow");
      }
    </script>
    
    <style type="text/CSS"><!-- added 032611-->
    <!--
        .code { color: red; }
        .back { background-color: yellow; }
    -->
    </style>
  </head>

  <body>
  <h1>Slide paragraphs up and down</h1>
  <div>
  <p id="first">This is paragraph 1.</p>
  <p>This is paragraph 2.</p>
  <p>This is paragraph 3.</p>
  <p>This is paragraph 4.</p>
  </div>
  <form action="">
   <input type = "button" value="Slide up" onclick="slideup()"></input>
   <input type = "button" value="Slide down" onclick="slidedown()"></input>
  </form>