首页javascriptpjQuery HTML Element - 如何使用其在列表中的位置索引修改li元素...

jQuery HTML Element - 如何使用其在列表中的位置索引修改li元素...

我们想知道如何使用其在列表中的位置索引修改li元素。...


<html>
  <head>
    <script type="text/javascript" src='http://code.jquery.com/jquery-1.5.2.js'></script>
    <script type="text/javascript">
        $(document).ready(function(){
              $("p:odd").removeClass("blue");
        });
    </script>
  </head>
   <style>
      .blue { color:blue; }
  </style>
  <body>
    <body>
      <p class=blue>A</p>
      <p class=blue>A</p>
      <p class=blue>A</p>

  </body>
</html>