user198729
user198729

Reputation: 63626

How to select images whose src is set in jQuery?

Select these:

<img src="...">

but not:

<img />

Upvotes: 1

Views: 138

Answers (2)

hallie
hallie

Reputation: 2845

var imgFile = $("img").attr("src");

Upvotes: 1

Sander Rijken
Sander Rijken

Reputation: 21615

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

$("img[src]")

Upvotes: 8

Related Questions