change order divs with jQuery

后端 未结 7 1010
长发绾君心
长发绾君心 2020-12-08 07:44
aaa
bbb
ccc

Is poss

7条回答
  •  半阙折子戏
    2020-12-08 08:40

    If you want to change the order of group of divs with same class name (eg. given below):

    First Heading 1
    Second Heading 2
    Third Heading 3

    You can reorder it by the following jQuery code:

    $('.wrapper .number').each(function () {
      $(this).insertBefore($(this).prev('.text'));
    });
    

    https://jsfiddle.net/farhanmae/9th3drvd/

提交回复
热议问题