jquery move element to last child position

前端 未结 6 482
迷失自我
迷失自我 2021-01-01 10:40

Let\'s say I have a

that contains some random elements, but there is one element I\'ve created with this unique selector : $(\'.myUniqueElemen
6条回答
  •  一向
    一向 (楼主)
    2021-01-01 11:37

    There is no need to call $ more than once, just move the element to the end of its parent:

    var myEl = $('.my-el-selector');
    myEl.appendTo(myEl.parent());
    

提交回复
热议问题