// 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" ]);