简体   繁体   中英

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

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

尝试

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM