Valid XHTML 1.0 Transitional

jQuery: Selecting elements by attribute (language)

This is paragraph 1.

This is paragraph 2.

This is paragraph 3.

This is paragraph 4.

The jQuery Code START
        
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
      function setStyle1() {
        $('p[lang]').css("font-style","italic");
      }
      function setStyle2() {
        $('p[lang]').css("font-style","normal");
      }
    </script>
    
    <style type="text/CSS">
    <!--
        .code { color: red; }
        .back { background-color: yellow; }
    -->
    </style>
  </head>

  <body>
  <h1>jQuery: Selecting elements by attribute (language)</h1>
  <div>
  <p>This is paragraph 1.</p>
  <p lang="English">This is paragraph 2.</p>
  <p>This is paragraph 3.</p>
  <p>This is paragraph 4.</p>
  </div>
  <form>
   <input type = "button" value="Select 3/italicize" onclick="setStyle1()"></input>
   <input type = "button" value="Select 3/normal" onclick="setStyle2()"></input>
   
  </form>