Valid XHTML 1.0 Transitional

Selecting the third/nth child

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=""></script>
    <script type="text/javascript">
      function setStyle1() {
      function setStyle2() {
      function setStyle3() {
      function setStyle4() {
    <style type="text/CSS">
        .code { color: red; }
        .back { background-color: yellow; }

  <h1>Selecting the first and last children</h1>
  <p>This is paragraph 1.</p>
  <p>This is paragraph 2.</p>
  <p>This is paragraph 3.</p>
  <p>This is paragraph 4.</p>
  <form action="">
   <input type = "button" value="Select"onclick="setStyle1()"></input>
   <input type = "button" value="Select"onclick="setStyle2()"></input>
   <input type = "button" value="Select"onclick="setStyle3()"></input>
   <input type = "button" value="Select"onclick="setStyle4()"></input>