jquery根据属性和index来查找属性值并操作 程序员文章站 2022-04-02 10:47:40 <p 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> </p> 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"); 上一篇: mysql解压缩方式安装和彻底删除的方法图文详解 下一篇: 一个简单的jQuery插件ajaxfileupload.js实现ajax上传文件例子 推荐阅读 jquery根据属性和index来查找属性值并操作 jquery根据属性和index来查找属性值并操作_jquery jquery根据属性和index来查找属性值并操作_jquery jquery根据属性和index来查找属性值并操作