$(:eq(index)) 选定下标为index的值。例如:$('.aaron:eq(1)).css("border", "3px groove blue");
class属性为aaron的第二个标签加3的边框
$(':gt(index)') 选定下标大于index的内容$('.aaron:gt(3)').css("border", "3px groove blue");
class属性为aaron的大于4个以后的标签加边框线
$(':lt(index)') 选定小与下标index的值,例如:$(".aaron:lt(3)").css("color", "#CD00CD");
class属性为aaron的小于3个以后的标签加字体颜色
内容赛选选择器
$(’:contains(text)’) 选择所有包含指定文本的元素
$(’:parent’) 选择所有含有子元素或者文本的元素
$(’:empty’) 选择所有没有子元素的元素(包含文本节点)
$(’:has(selector)’) 选择元素中至少包含指定选择器的元素
//查找所有div中,有属性testattr中的值没有包含"true"的div
$(‘div[testattr!=“true”]’).css(“border”, “3px groove #668B8B”);
子元素选择器
表单元素选择器
表单对象属性筛选选择器
//查找所有input所有勾选的元素(单选框,复选框)
//移除input的checked属性
$(‘input:checked’).removeAttr(‘checked’)
//查找所有option元素中,有selected属性被选中的选项
//移除option的selected属性
$(‘option:selected’).removeAttr(‘selected’)