Alessandro
Alessandro

Reputation: 1

get the src from img tag

I am using ajax to grab a page.

withing a table lies an imagesrc i want to grab.. It is wrapped around an A tag with a class name

i use the following

$response.find(".infobox tr").each(function(){
$a=$(this).find(".image").html();
}

but it returns the image tag <img src="http://uwww.domain.com.au/image.jpg" height="333" width="256">

i have tried the attr("src") and other methods but to no avail.. is there a trick i am missin

Upvotes: 0

Views: 2158

Answers (2)

Reigel Gallarde
Reigel Gallarde

Reputation: 65254

try

$a=$(this).find(".image img").attr("src")

Upvotes: 0

fl00r
fl00r

Reputation: 83680

$a=$(this).find(".image img").attr("src")

Upvotes: 2

Related Questions