jquery根據(jù)屬性和index來查找屬性值并操作
更新時間:2014年07月25日 15:30:32 投稿:whsnow
這篇文章主要介紹了jquery如何根據(jù)屬性和index來查找屬性值并操作,需要的朋友可以參考下
<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");
您可能感興趣的文章:
相關文章
BootStrap輕松實現(xiàn)微信頁面開發(fā)代碼分享
本文給大家分享一段代碼關于bootstrap實現(xiàn)微信開發(fā)頁面的代碼,非常不錯代碼簡單易懂,感興趣的朋友一起看看吧2016-10-10jQuery Ajax和getJSON獲取后臺普通json數(shù)據(jù)和層級json數(shù)據(jù)用法分析
這篇文章主要介紹了jQuery Ajax和getJSON獲取后臺普通json數(shù)據(jù)和層級json數(shù)據(jù)用法,結合實例形式分析了jQuery基于ajax操作json格式數(shù)據(jù)的相關技巧,需要的朋友可以參考下2016-06-06jQuery插件jsonview展示json數(shù)據(jù)
這篇文章主要為大家詳細介紹了jQuery插件jsonview展示json數(shù)據(jù)的方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-05-05