Might want to try something like this instead:

$(".gallery img").each(function()
{
      $('#bild_spel div ul').append('<li><img src=" '+$(this).attr
('src')+' " alt=""></li>');
});

haven't tested it but I believe it's correct :)

On Mar 30, 11:48 am, smurkas <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to