var s = $("img[src='/images/greendot.gif'][name='BS']");
html:
<img alt="This item is active." name="BS" src="/images/greendot.gif"/>
vs
<img alt="This item is not active." name="BS" src="/images/spacer.gif"/>
$("img[src$='greendot.gif'][name='BS']")
给出以下HTML:
<img src="http://assets0.twitter.com/images/twitter_logo_header.png" name="logo" />
这个jquery工作:
var x = $("img[src$='twitter_logo_header.png'][name='logo']"); alert(x.attr("src"));