zl程序教程

您现在的位置是:首页 >  前端

当前栏目

jquery常用选择器总结详解编程语言

jQuery编程语言 详解 总结 常用 选择器
2023-06-13 09:20:40 时间
$(‘E F’) 后代选择器,用空格分隔,匹配E元素所有的后代(不只是子元素、子元素向下递归)元素F

除了上面的选择器,我们还要了解一点点筛选的方法:

.find(selector) 查找集合每个元素的子节点

Get the descendants(子节点) of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.

$(li.item-ii).find(li).css(background-color, red);
.filter(selector) 过滤当前集合内元素

Reduce(减少) the set of matched elements to those that match the selector or pass the function’s test.

$(li).filter(:even).css(background-color, red);

13956.html

cjava