tags:

views:

23

answers:

1

I'm trying to grab the source of an image with jquery.

My HTML looks like this:

<div class="featuredSlideImage">
    <img src="http://apture.s3.amazonaws.com/0000012865c9e9d984b36217007f000000000001.latte%20heart.jpg"/&gt;
</div> <!--featuredSlideImage-->

My jQuery Selector is:

    return '<li>' + jQuery(slide).children(".featuredSlideImage").html();  + '</li>'; 

which reutrns this:

<img src="http://apture.s3.amazonaws.com/0000012865c9e9d984b36217007f000000000001.latte%20heart.jpg"/&gt;

I was to just return the source of that, sans the HTML. How can I go about this?

+1  A: 
alert( jQuery(slide).find(".featuredSlideImage > img").attr("src") )
// http://apture.s3.amazonaws.com/0000012865c9e9d984b36217007f000000000001.latte%20heart.jpg

gives you just the Image url

test it here: http://jsfiddle.net/FbAPQ/

meo
Great, thanks that worked!
Wes