I need to be able to reorder elements based on criteriaso I tried coming up with a sorting function. I ended up with something along these lines:
var myElems = $(mySelector); var temp = myElems.get ().sort (function (a, b) {// sort code goes here}); myElems = $(temp); This seems to work but it got me wondering, is there any sorting functionality built into the jquery core? Would I be able to avoid the second jQuery invokation and the associated overhead (myElems = $ (temp);)? Or is what I've come up with as good as can be done?