jQuery order by date in data attribute

前端 未结 3 2007

If i have this markup:

item 1

item 1

3条回答
  •  长情又很酷
    2020-12-24 09:58

    The custom function suggested in Joseph's answer (the currently accepted solution) should return a numeric value, not a boolean. See This other question where this issue has already been raised showing that this function will not work in IE.

    The "dates.compare(a,b)" function defined here looks like a better fit for use in jQuery's sort method.

提交回复
热议问题