jquery过滤器(first,last,not,even,odd简单应用)
2012-01-11 13:24
218 查看
1.点击时高亮显示
2.过滤器(first,last,not,even,odd简单应用)
$(function(){ $(".menuitem").click(function(){ $(this).addClass("highlight").siblings().removeClass("highlight"); }); });
2.过滤器(first,last,not,even,odd简单应用)
$(function(){ $("#ul1 li:first").click(function(){ $(this).addClass("b"); }); $("#ul1 li:last").text("AAAAA");//最后一个li的元素的innerText $("#ul1 li:first").text("FFFFFF");//第一个li的元素的innerText $("#ul1 li:not(.a)").text("ZZZZ");//样式不会class="a"的元素 $("#ul2 li:even").text("奇数行"); $("#ul2 li:odd").text("偶数行"); });
相关文章推荐
- Jquery 过滤器(first,last,not,even,odd)应用
- Jquery 过滤器(first,last,not,even,odd)的使用
- jquery基本过滤选择器:first :last :not(.myclass) :even :odd :eq(1) :gt(5) :lt(1) :header :animated :focus
- jQuery——jQuery基础方法first()/last()/not(CSS选择器)/even/odd/eq(index)/gt(index)/lt(index)
- Jquery 过滤器(first,last,not,even,odd)的使用
- Grid - last row not removed when deleted even though reload
- (转帖)如何将字符串前后的空白去除? (使用string.find_first_not_of, string.find_last_not_of) (C/C++)
- 个人 WPF+EF(DBFirst) 简单应用开发习惯及EF学习测试(备忘) -- 2
- 如何将字符串前后的空白去除? (使用string.find_first_not_of, string.find_last_not_of) (C/C++)
- jQuery 遍历 - 过滤---first--last---eq--not--filter方法(二十五)
- java的subString和lastIndexOf的简单应用
- Oracle应用专题之:分析函数3(Top/Bottom N、First/Last、NTile)
- jquery笔记:筛选 eq,first,last,filter,is,has, not, children,closest, nextUntil,parents,parentsUntil.....
- Visiting the Ikea stores can be very overwhelming even if it is not your first time. If it is your first time
- Oracle应用专题之:分析函数3(Top/Bottom N、First/Last、NTile)
- C++基础---string类的find/find_first_of/find_first_not_of/rfind/find_last_of/find_last_not_of
- 实战c++中的vector系列--vector应用之STL的find、find_if、find_end、find_first_of、find_if_not(C++11)
- Oracle应用专题之:分析函数3(Top/Bottom N、First/Last、NTile)
- 实战c++中的vector系列--vector应用之STL的find、find_if、find_end、find_first_of、find_if_not(C++11)
- 知识点七:jQuery 遍历 - 过滤first(), last() 和 eq(),filter() 和 not()