Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create the add-on
- $.fn.orderChildren = function(order) {
- this.each(function() {
- var el = $(this);
- for(var i = order.length; i >= 0; i--) {
- el.prepend(el.children(order[i]));
- }
- });
- return this;
- };
- // Call the add-on
- $(".user").orderChildren([
- ".phone",
- ".email",
- ".website",
- ".name",
- ".address"
- ]);
Advertisement
Add Comment
Please, Sign In to add comment