If I'm understanding the problem correctly, you'll want this: $(".gallery img").clone().appendTo("#bild_spel div ul").wrap("<li></li>");
(remove the .clone() if you want to move the img elements, as well) --John On Mon, Mar 30, 2009 at 6:48 AM, smurkas <marcus.dalg...@gmail.com> wrote: > > Hello. > > I have a situation where I have grabbed a couple of images off a page > and want to insert them again into an unordered list. Grabbing the > images was no problem but I don't know what to write when inserting > them again. > The code below does not result in the images being inserted again, > instead each list item contains > [object HTMLImageElement] as text. I also tried wrapping this in $ > (this) but that didn't work either. The solution is probably dead > simple but right now I am missing it. Can anyone help me out? > > var img = $(".gallery img"); > $(img).each(function() { > $("#bild_spel div ul").append('<li>'+this+'</li>'); > }); > > > Kindly, Marcus. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---