tags:

views:

39

answers:

2

Select these:

<img src="...">

but not:

<img />
+1  A: 
var imgFile = $("img").attr("src");
hallie
This selects the attribute `src` on `img` elements, not `img` elements that have an src attribute
Sander Rijken
+8  A: 

See http://docs.jquery.com/Selectors

$("img[src]")
Sander Rijken
cf doc: "[attribute] Matches elements that have the specified attribute."
marcgg