jquery根據(jù)屬性和index來查找屬性值并操作
更新時(shí)間: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)文章
BootStrap輕松實(shí)現(xiàn)微信頁面開發(fā)代碼分享
本文給大家分享一段代碼關(guān)于bootstrap實(shí)現(xiàn)微信開發(fā)頁面的代碼,非常不錯(cuò)代碼簡單易懂,感興趣的朋友一起看看吧2016-10-10jQuery Ajax和getJSON獲取后臺(tái)普通json數(shù)據(jù)和層級json數(shù)據(jù)用法分析
這篇文章主要介紹了jQuery Ajax和getJSON獲取后臺(tái)普通json數(shù)據(jù)和層級json數(shù)據(jù)用法,結(jié)合實(shí)例形式分析了jQuery基于ajax操作json格式數(shù)據(jù)的相關(guān)技巧,需要的朋友可以參考下2016-06-06jquery中l(wèi)oad方法的用法及注意事項(xiàng)說明
本篇文章主要是對jquery中l(wèi)oad方法的用法及注意事項(xiàng)進(jìn)行了詳細(xì)介紹,需要的朋友可以過來參考下,希望對大家有所幫助2014-02-0230個(gè)最佳jQuery Lightbox效果插件分享
Lightbox 應(yīng)該是最流行的圖片瀏覽效果了,常具有功能包括:自動(dòng)根據(jù)窗口的大小縮放圖片,模式窗口,幻燈片方式播放,內(nèi)容預(yù)加載,漸變等效果。2011-04-04jQuery插件jsonview展示json數(shù)據(jù)
這篇文章主要為大家詳細(xì)介紹了jQuery插件jsonview展示json數(shù)據(jù)的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-05-05通過上下左右鍵和回車鍵切換光標(biāo)實(shí)現(xiàn)代碼
客戶有這樣一個(gè)需求在列表中的文本框里輸入數(shù)據(jù)時(shí),要能夠通過上下左右鍵來切換光標(biāo),按回車鍵就把光標(biāo)移到下一個(gè)文本框,接下來將為你介紹下如何實(shí)現(xiàn),感興趣的朋友可以參考下2013-03-03