If you used each then it should repeat for each DIV with the class of
box on the page.

$(document).ready(function(){
     $("div.box").each(function() {
          $("div.box> *").wrapAll('<div class="inside"></div>');
          $("div.box").append('<div class="tl"></div>'+'<div
class="tr"></div>'+'<div class="bl"></div>'+'<div class="br"></
div>');
     });
});

What exactly are you trying to achieve though? Couldn't you just have
all the DIVs laid out already and then style them with CSS to make
them look the same?


On Sep 26, 2:17 pm, thelemondropkid <[EMAIL PROTECTED]> wrote:
> Thanks to the help I have received on this group, I am making
> progress.
> But now that all is working fine, the question beckons: Can jQuery do
> it all over again?
>
> This is my code:
>
> <div class="box">
>     <h3>some header</h3>
>     <img name="Image" src="photo.jpg" width="268" height="122" alt="" /
>
>     <p>Lorem ipsum dolor sit amet.</p>
> </div>
>
> And the jQuery:
>
> $(document).ready(function(){
>         $("div.box> *").wrapAll('<div class="inside"></div>');
>         $("div.box").append('<div class="tl"></div>'+'<div class="tr"></
> div>'+'<div class="bl"></div>'+'<div class="br"></div>');
>
> });
>
> The problem:
>
> I would have thought that jQuery would repeat the above process if I
> created another div with a class of "box" below the previous one. I
> was wrong!
>
> Is there a way to do that because I would like to create various boxes
> with a class of "box" and have them all look the same.
>
> Thanks folks

Reply via email to