:disabled:获取所有不可用表单元素 :checked:获取所有选中的表单元素,主要针对 radio 以及 checkbox :selected:所有所有选中的表单元素,主要针对 select
2. :last 选取最后一个元素$(“div:last”) 选取所有div中的最后一个元素 3. :not(selector) 去除所有与给定选择器匹配的元素 $(“input:not(.myclass)”) 选取class不是myclass的<input>元素 4. :even 选取索引是偶数的所有元素,索引从0开始 $(“input:even”)选取索引是偶数的<input> 5. :odd 选...
说明: 匹配找到的最后一个元素.与 :first 相对应.3、:not(selector) 用法: $("input:not(:checked)") 返回值 集合元素 说明: 去除所有与给定选择器匹配的元素.有点类似于”非”,意思是没有被选中的input(当input的 type=”checkbox”).4、:even 用法: $("tr:even") 返回值 集合元素 说明: 匹配所有...
语法:$(“not(selector)”) 作用:不包括指定内容的元素 代码语言:javascript 代码运行次数:0 运行 AI代码解释 // 改变class不为 one 的所有 div 元素的背景色为 红色" id="b3 $("#b3").click(function () { $("div:not(.one)").css("backgroundColor","red"); }); 4、偶数选择器 语法:$(“...
:not(selector) not表示排除掉的意思,所以这个简单伪类选择器表示获取相反的其他元素。代码参考教材2.1.4节。 :first :last :odd :even 选择集合中的第一项、最后一项、偶数行项、奇数行项。代码参考教材2.1.4节。 :eq :lt :gt 选择集合中的某一项,选择集合中所有小于指定的项、选择集合中所有大于指定项的项...
The.not()method will end up providing you with more readable selections than pushing complex selectors or variables into a:not()selector filter. In most cases, it is a better choice. Example: Finds all inputs that are not checked and highlights the next sibling span. Notice there is no ...
语法:$(“not(selector)”) 作用:不包括指定内容的元素 // 改变class不为 one 的所有 div 元素的背景色为 红色" id="b3 $("#b3").click(function () { $("div:not(.one)").css("backgroundColor","red"); }); 4、偶数选择器 语法:$(“A:even”) 作用:从0开始计数,获得选择的元素中索引为...
E:not(selector):匹配元素且不包括selector。 E:target:匹配相关URL指向的E元素。 5.以下的选择器是jQuery的扩展,不属于css选择器。因此不能利用浏览器的内置函数querySelectorAll()(querySelectorAll是浏览器内置的css选择符查询元素方法,比getElementsByTagName和getElementsByClassName效率要高很多。)。
3、:not(selector) 用法: $(“input:not(:checked)”) 返回值 集合元素 说明: 去除所有与给定选择器匹配的元素.有点类似于”非”,意思是没有被选中的input(当input的 type=”checkbox”). 4、:even 用法: $(“tr:even”) 返回值 集合元素
:not(selector)取出所有与给定选择器匹配的元素 :even选取索引时偶数的所有元素,从0开始 :odd同上奇数 :eq(index)索引等于index的元素 :gt(index)大于index的元素 :lt(index)小于... :header所有标题元素,h1,h2,h3等等 :animated 当前正在执行动画的所有元素 2.内容...