Wrap 3 divs in one with jQuery

后端 未结 1 1331
太阳男子
太阳男子 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('<div class="wrap">');
    

    or

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

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

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