Try this (untested):
$('div.box').each(function(count, box) {
    $(box).append('<div class="summary"><p class="sml">' + $('dd p',
box).html() + '</p></div>');
});

On Jan 23, 2008 5:01 PM, Raymond <[EMAIL PROTECTED]>
wrote:

>
> I was wondering if anyone knows of a less processor intensive way of
> doing the following code?
>
> I am trying to loop over all classes of a certain type on the page and
> then append some html that is contained within that particular class.
> What it is doing to the user is collapsing the search results into a
> "summary" of each as the length of the original result set can be long
> to scroll through.
>
> var count = 0;
>                        $('div.box').each(function()
>                        {
>                                $('div.box:eq(' + count + ')').append('<div
> class="summary"><p
> class="sml">' + $('div.box:eq(' + count + ') dd p').html() + '</p></
> div>');
>                                count = count + 1;
>                        });
>



-- 
Aaron Heimlich
Web Developer
[EMAIL PROTECTED]
http://aheimlich.freepgs.com

Reply via email to