Wrap HTML with DIV until next H3

后端 未结 2 623
不思量自难忘°
不思量自难忘° 2020-12-21 04:35

I have the following HTML structure:

2条回答
  •  暖寄归人
    2020-12-21 05:14

    An approach like this should work, though I'm guessing there are many different ways of doing this:

    $('#subgroup h3').each(function() {
        $(this).nextUntil('h3').wrapAll('
    '); });

提交回复
热议问题