What jquery expression would give me ['a','b'] for the doc <tag att1='a' /><tag att1='b' />.
The actual case I’m working on is to list an array of all the images used in an html doc (not the tags, but the actual locations of the images). So the desired result will be something like ["http://mywebsite.com/path_to_image_1.jpg", ...] for a document that contains snippets like:
<img src="http://mywebsite.com/path_to_image_1.jpg" />
<img src="http://mywebsite.com/path_to_image_2.jpg" />
I really don’t want to have to list all the <img> tags, then iterate manually to get the src attribute.
1 Answer