DaveG schrieb:

Am I just going the wrong way? Should I switch to normal loop, or an each loop? Comments?
$(".a")
   .each(function(i){
$(this).wrap('<div class="outter ' +$(this).attr("class")+ '"></div>')
      .removeClass().addClass("z");
});

Here's my attempt. It works. Is there a better/different way, perhaps not using the each, but simply chaining?

attr() accepts a function as the value-argument. That may allow you to get rid of the each-call, but you need a function anyway.

--
Jörn Zaefferer

http://bassistance.de

Reply via email to