×

jquery根据属性和index来查找属性值并操作

作者:Terry2017.02.11来源:Web前端之家浏览:9647评论:0
关键词:JQueryJS
<div class="zy_menu clearfix">
<a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="1" id="assoeted1" class="hover_a">课件库</a> <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="2" id="assoeted2">课堂实录</a> <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="3" id="assoeted3">试题库</a> <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="4" id="assoeted4">教案库 </a> <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="5" id="assoeted5">素材库 </a>
</div>
var assoeted =5;

$(".zy_menu a[rel="+assoeted+"]").removeClass("hover_a").addClass("hover_a");
$(".zy_menu a").removeClass("hover_a").eq(assoeted-1).addClass("hover_a");

您的支持是我们创作的动力!
温馨提示:本文作者系Terry ,经Web前端之家编辑修改或补充,转载请注明出处和本文链接:
https://jiangweishan.com/article/svg1486742400654.html

网友评论文明上网理性发言 已有0人参与

发表评论: