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">課堂實(shí)錄</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");
您可能感興趣的文章:
- jQuery .attr()和.removeAttr()方法操作元素屬性示例
- jquery操作checked屬性以及disabled屬性的多種方法
- JQuery節(jié)點(diǎn)元素屬性操作方法
- jQuery元素屬性操作實(shí)例(設(shè)置、獲取及刪除元素屬性)
- jQuery操作屬性和樣式詳解
- 詳解jQuery中的元素的屬性和相關(guān)操作
- 有關(guān)jquery與DOM節(jié)點(diǎn)操作方法和屬性記錄
- jQuery 操作 HTML 元素和屬性的方法
- jQuery使用each遍歷循環(huán)的方法
- jquery進(jìn)行數(shù)組遍歷如何跳出當(dāng)前的each循環(huán)
- JQuery屬性操作與循環(huán)用法示例
相關(guān)文章
javaScript和jQuery自動加載簡單代碼實(shí)現(xiàn)方法
給大家介紹一下利用javaScript和jQuery實(shí)現(xiàn)自動加載最簡單的代碼寫法。2017-11-11
用Jquery.load載入頁面實(shí)現(xiàn)局部刷新
用jquery.load的方法載入新的頁面,以實(shí)現(xiàn)局部刷新,可結(jié)果發(fā)現(xiàn)載入進(jìn)來的頁面與原來單獨(dú)的頁面不一樣,樣式?jīng)]了,關(guān)于這個問題,下面有個不錯的解決方法2014-01-01
jQuery實(shí)現(xiàn)簡潔的導(dǎo)航菜單效果
這篇文章主要介紹了jQuery實(shí)現(xiàn)簡潔的導(dǎo)航菜單效果,簡潔大方的導(dǎo)航菜單,需要的朋友可以參考下2015-11-11
jQuery實(shí)現(xiàn)的簡單拖拽功能示例【測試可用】
這篇文章主要介紹了jQuery實(shí)現(xiàn)的簡單拖拽功能,涉及jQuery基于事件響應(yīng)及頁面元素屬性動態(tài)操作實(shí)現(xiàn)拖拽功能的相關(guān)操作技巧,需要的朋友可以參考下2018-08-08
jquery獲取table中的某行全部td的內(nèi)容方法
jquery獲取table中的某行全部td的內(nèi)容方法,需要的朋友可以參考一下2013-03-03

