jquery reorder divs

前端 未结 4 602
旧巷少年郎
旧巷少年郎 2021-01-04 20:59

I have 3 divs want to reverse the order on doucment ready

First
Second
4条回答
  •  独厮守ぢ
    2021-01-04 21:37

    First
    Second
    Third

    And try this in Jquery

    $('#parent > div').each(function() {
        $(this).prependTo(this.parentNode);
    });​
    

    You can see example in jsfiddle http://jsfiddle.net/N7PGW/

提交回复
热议问题