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():还没看

原文地址:https://www.cnblogs.com/wang-jing/p/4599226.html