Valid XHTML 1.0 Transitional

Count paragraphs

This is paragraph 1.

This is paragraph 2.

This is paragraph 3.

This is paragraph 4.

The Code START
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
        function count() {
            alert("There are " + $("p").size() + " paragraphs.");
        }
</script>
<style type="text/CSS">
        <!--
        .code { color: red; }
        .back { background-color: yellow; }
        -->
   </style>
  </head>

  <body>
  <h1>Count paragraphs</h1>
  <div>
  <p>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="Count Paragraphs" onclick="count()"></input>
  </form>