Created
September 12, 2014 13:21
-
-
Save xat/4f05f3e0d1f54c2daeda to your computer and use it in GitHub Desktop.
jquery sort elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.sorty = function(fn) { | |
return this.each(function() { | |
var $el = $(this); | |
$el.html($el.children().sort(fn)); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment