【发布时间】:2015-07-14 01:36:43
【问题描述】:
我正在使用下面的代码:
$('.graph-img').each(function(index) {
$(this).prev('h2,h3,h4,h5,h6,p').prevUntil('.graph-img').andSelf().not('h1').wrapAll("<div class='prevent-break'>");
});
它包装了所有元素,但不包括当前引用的.graph-img。任何想法为什么?
【问题讨论】:
标签: javascript jquery wrapall