分享java帶來(lái)的快樂(lè)

          我喜歡java新東西

          jquery選擇器

          — 基本選擇器

          — $("#txt").css("background-color","red");

          — 設(shè)置idtxt的元素

          — $("p").css("background-color","blue");

          — 設(shè)置p元素

          — $(".myclass").css("background-color","yellow");

          — 設(shè)置classmyclass的元素

          — $(".myclass,#txt").css("background-color","gray");

          — 設(shè)置classmyclass以及idtxt的元素

           

          — 層次選擇器

          — $("#mydiv span").css("background-color","green");

          — 設(shè)置mydiv所有span子孫元素

          — $("#mydiv>span").css("background-color","pink");

          — 設(shè)置mydiv所有span兒子元素

          — $("#mydiv+span").css("background-color","pink");

          — 設(shè)置mydiv后所有span兄弟元素

           

          — 表單選擇器

          — $(":input").css("background-color","green");

          — 設(shè)置所有表單元素

          — $(":text").css("background-color","pink");

          — 設(shè)置所有文本框

          — $(":button").css("background-color","pink");

          — 設(shè)置所有按鈕

           

          — 基本過(guò)濾器

          — $(".class1:first").css("background-color","green");

          — 設(shè)置所有classclass1的元素的第一項(xiàng)

          — $(".class1:last").css("background-color","green");

          — 設(shè)置所有classclass1的元素的最后一項(xiàng)

          — $(".class1:even").css("background-color","green");

          — 設(shè)置所有classclass1的元素的偶數(shù)項(xiàng)

          — $(".class1:odd").css("background-color","green");

          — 設(shè)置所有classclass1的元素的奇數(shù)項(xiàng)

          — $(".class1:eq(3)").css("background-color","green");

          — 設(shè)置所有classclass1的元素中下標(biāo)為3的項(xiàng)

          — $(".class1:gt(3)").css("background-color","green");

          — 設(shè)置所有classclass1的元素中下標(biāo)大于3的項(xiàng)

          — $(".class1:lt(3)").css("background-color","green");

          — 設(shè)置所有classclass1的元素中下標(biāo)小于3的項(xiàng)

          — $(".class1:not(p)").css("background-color","green");

          — 設(shè)置所有classclass1的元素中不為p的項(xiàng)

           

          — 屬性過(guò)濾器

          — $(".class1[id]").css("background-color","green");

          — 設(shè)置所有classclass1的元素中具有id屬性的項(xiàng)

          — $(".class1[name='txt']").css("background-color","green");

          — 設(shè)置所有classclass1的元素中name屬性值為txt的項(xiàng)

          — $(".class1[name!='txt']").css("background-color","green");

          — 設(shè)置所有classclass1的元素中name屬性值為txt的項(xiàng)

          — $(".class1[name^='txt']").css("background-color","green");

          — 設(shè)置所有classclass1的元素中name屬性值以txt開頭的項(xiàng)

          — $(".class1[name$='txt']").css("background-color","green");

          — 設(shè)置所有classclass1的元素中name屬性值以txt結(jié)尾的項(xiàng)

          — $(".class1[name*='txt']").css("background-color","green");

          — 設(shè)置所有classclass1的元素中name屬性值包含txt的項(xiàng)

          — $(".class1[id][name='txt']").css("background-color","green");

          — 設(shè)置所有classclass1的元素中有id屬性并且name屬性值為txt的項(xiàng)

           

          — 表單過(guò)濾器

          — $(":text:disabled").css("background-color","green");

          — 設(shè)置所有禁用的文本框

          — $(":button:enabled").css("background-color","green");

          — 設(shè)置所有啟用的按鈕

          — $(":checkbox:checked").css("background-color","green");

          — 設(shè)置所有選中的復(fù)選框

           

          — 內(nèi)容過(guò)濾器

          — $("div:contains('gcd') ").css("background-color","green");

          — 設(shè)置所有包含gcd字符串的div

          — $("div:has(p)").css("background-color","green");

          — 設(shè)置所有包含段落的div

          — $("td:empty").css("background-color","green");

          — 設(shè)置所沒(méi)有內(nèi)容的單元格

          posted on 2010-01-11 14:41 強(qiáng)強(qiáng) 閱讀(284) 評(píng)論(0)  編輯  收藏 所屬分類: web技巧

          主站蜘蛛池模板: 太仓市| 张掖市| 临夏市| 县级市| 江川县| 松江区| 承德市| 北川| 高安市| 南汇区| 镇巴县| 防城港市| 潮州市| 金华市| 宾川县| 南部县| 民权县| 焉耆| 九龙城区| 屏山县| 龙胜| 句容市| 贡觉县| 静乐县| 穆棱市| 福鼎市| 庆城县| 嘉义县| 柳林县| 常德市| 华坪县| 轮台县| 通江县| 保山市| 普宁市| 尉氏县| 巴彦县| 墨玉县| 安仁县| 交城县| 台湾省|