How to combine two divs that have the same class - jQuery

后端 未结 5 1313
悲&欢浪女
悲&欢浪女 2020-12-11 09:24

I have a div structure like this

5条回答
  •  自闭症患者
    2020-12-11 09:36

    You can do it like this

    $('.itemRow:first') // select first itemRow
       .append($('.item')) // append all .item to first itemRow
       .nextAll('.itemRow') // get all the next .itemRow
       .remove(); // remove the them
    

    FIDDLE

提交回复
热议问题