jquery: reverse an order

前端 未结 5 1135
执念已碎
执念已碎 2021-02-05 20:47

How can I reverse an order with jquery?

I tried with the suggestion like this but it won\'t work!

$($(\".block-item\").get().reverse()).each(function() {         


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-05 21:19

    Your code is working. Just choose jQuery framework on the left hand.

     $($(".block-item").get().reverse()).each(function() {
         $(this).appendTo($(this).parent());
     });
    

提交回复
热议问题