Wrap 3 divs in one with jQuery

后端 未结 1 1332
太阳男子
太阳男子 2020-12-15 07:49

I need to wrap 3 divs into one using jQuery.

1条回答
  •  一生所求
    2020-12-15 08:03

    $('.one, .two, .three').wrapAll('
    ');

    or

    $('.one, .two, .three').wrapAll( $('
    ').addClass('wrap') );

    Reference: http://docs.jquery.com/Manipulation/wrapAll

    0 讨论(0)
提交回复
热议问题