首页 > Web开发 > 详细

jQuery 遍历 - eq() 方法

时间:2017-09-13 14:48:25      阅读:232      评论:0      收藏:0      [点我收藏+]
<!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");

 

jQuery 遍历 - eq() 方法

原文:http://www.cnblogs.com/flytogalaxy/p/7514519.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!