How to sort divs according to their id using jQuery?

前端 未结 3 904
太阳男子
太阳男子 2020-12-01 19:31

I have a set of divs with random ids:

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 20:01

    I'd use the tinysort plugin:

    http://tinysort.sjeiti.com/

    In your case it would be something like:

    $("#container > div").tsort("",{attr:"id"});

提交回复
热议问题