jquery: reverse an order

前端 未结 5 1141
执念已碎
执念已碎 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:34

    If you have a container around the list, it's a little easier:

    $("#container").append($(".block-item").get().reverse());

    http://jsfiddle.net/BhTEN/12/

提交回复
热议问题