$(function(){//改变第一个 div 元素的背景色为 红色$("div:first").css("backgroundColor","red")// 改变最后一个 div 元素的背景色为 红色$("div:last").css("backgroundColor","red")// 改变class不为 one 的所有 div 元素的背景色为 红色$("div:not(.one)").css("backgroundColor","red")// 改变索引值为偶数的 div 元素的背景色为 红色$("div:even").css("backgroundColor","red")// 改变索引值为奇数的 div 元素的背景色为 红色$("div:odd").css("backgroundColor","red")// 改变索引值为大于 3 的 div 元素的背景色为 红色$("div:gt(3)").css("backgroundColor","red")// 改变索引值为等于 3 的 div 元素的背景色为 红色$("div:eq(3)").css("backgroundColor","red")// 改变索引值为小于 3 的 div 元素的背景色为 红色$("div:lt(3)").css("backgroundColor","red")// 改变所有的标题元素的背景色为 红色$(":header").css("backgroundColor","red")})