jquery 方法学习

遍历

.add():将元素添加到jquery对象

argument:selector, element, html, jqueryObject
$('li').add('p').css('background-color', 'red');

.andSelf():新增自身对象到当前的jQuery对象里

$('li.third-item').nextAll().andSelf() .css('background-color', 'red');
url:http://runjs.cn/code/lg79p6jk

.children(selector):直接子元素

.closest():还没看

 

posted on 2015-06-25 09:45  j.w  阅读(87)  评论(0编辑  收藏  举报