jquery 初步(七) 子元素过滤选择器



1、选择以class为one 父元素的 第二个子元素  


$("div.one  : nth-child(2)")//选取子元素需要加一个空格





2、选择class为one的第一个子元素


  $("div.one :fiist-child")



3、选择class为one的最后一个·子元素


$("div.one  :last-child")



4、选择class为one只有一个子元素的 


$(".one :only-child")




posted on 2015-06-15 22:49  _故乡的原风景  阅读(121)  评论(0编辑  收藏  举报