jquery根據(jù)屬性和index來(lái)查找屬性值并操作
更新時(shí)間:2014年07月25日 15:30:32 投稿:whsnow
這篇文章主要介紹了jquery如何根據(jù)屬性和index來(lái)查找屬性值并操作,需要的朋友可以參考下
<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">課件庫(kù)</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">試題庫(kù)</a> <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="4" id="assoeted4">教案庫(kù) </a> <a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="5" id="assoeted5">素材庫(kù) </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自動(dòng)加載簡(jiǎn)單代碼實(shí)現(xiàn)方法
給大家介紹一下利用javaScript和jQuery實(shí)現(xiàn)自動(dòng)加載最簡(jiǎn)單的代碼寫法。2017-11-11
用Jquery.load載入頁(yè)面實(shí)現(xiàn)局部刷新
用jquery.load的方法載入新的頁(yè)面,以實(shí)現(xiàn)局部刷新,可結(jié)果發(fā)現(xiàn)載入進(jìn)來(lái)的頁(yè)面與原來(lái)單獨(dú)的頁(yè)面不一樣,樣式?jīng)]了,關(guān)于這個(gè)問(wèn)題,下面有個(gè)不錯(cuò)的解決方法2014-01-01
jquery 單引號(hào)和雙引號(hào)的區(qū)別及使用注意
在js中單引號(hào)和雙引號(hào)都是一樣的,平時(shí)使用的時(shí)候盡量用單引號(hào),只有碰到嵌套的時(shí)候才會(huì)同時(shí)用兩種引號(hào),感興趣的朋友可以了解下2013-07-07
jQuery實(shí)現(xiàn)簡(jiǎn)潔的導(dǎo)航菜單效果
這篇文章主要介紹了jQuery實(shí)現(xiàn)簡(jiǎn)潔的導(dǎo)航菜單效果,簡(jiǎn)潔大方的導(dǎo)航菜單,需要的朋友可以參考下2015-11-11
jQuery實(shí)現(xiàn)的簡(jiǎn)單拖拽功能示例【測(cè)試可用】
這篇文章主要介紹了jQuery實(shí)現(xiàn)的簡(jiǎn)單拖拽功能,涉及jQuery基于事件響應(yīng)及頁(yè)面元素屬性動(dòng)態(tài)操作實(shí)現(xiàn)拖拽功能的相關(guān)操作技巧,需要的朋友可以參考下2018-08-08
jquery對(duì)象訪問(wèn)是什么及使用方法介紹
這篇文章主要為大家詳細(xì)介紹了jquery對(duì)象訪問(wèn)是什么及使用方法介紹,感興趣的小伙伴們可以參考一下2016-05-05
jquery獲取table中的某行全部td的內(nèi)容方法
jquery獲取table中的某行全部td的內(nèi)容方法,需要的朋友可以參考一下2013-03-03

