jQuery 遍历

<!DOCTYPE html>
<html>
<head>
  <style>
  div { width:60px; height:60px; margin:10px; float:left;
        border:2px solid blue; }
  .blue { background:blue; }
  </style>
  <script type="text/javascript" src="/jquery/jquery.js"></script>
</head>

<body>
  <div></div>
  <div></div>
  <div></div>

  <div></div>
  <div></div>
  <div></div>

  <script>$("body").find("div").eq(1).addClass("blue");</script>
</body>
</html>
$(document).ready(function(){
    $("p:eq(1)").css("background-color","#B2E0FF");
});
$(".ky-crsos-menubar li:eq(0)").addClass("hit");
原文地址:https://www.cnblogs.com/flytogalaxy/p/7514519.html