我有这样的JS代码:的jQuery找到img标签,并从它那里得到SRC
var imgJPG = jQuery('img[src$=".jpg"]', '<div>' +
fullCode + '</div>').attr('href');
然而,它似乎并没有拿起图像的src? fullCode是HTML源代码。
的HTML:
<strong><span style="font-size: small;">
<img class="alignleft" title="ASHE" src="http://www.website.org/san-logo.jpg"
alt="" width="198" height="192" />Design (D) is an at the Annual Conference,
held July 15-18, 2012 in San, Florida.</span></strong>
我这么想吗?
你在.attr('src')寻找.attr('href')? – MarkSmits 2013-02-18 16:57:18
你是对的,马克。 – StealthRT 2013-02-18 17:04:45