Search code examples
javascriptjqueryarraysimagesrc

Src of all images with jquery


I want the src of all images from a div (lets call it "#all_imgs") in one simple array.

The array should look like this:

["http://src.de/3792282714_90584b41d5_b.jpg", 
 "http://src.de/1402810863_d41f360b2e_o.jpg"]

Thanks!


Solution

  • var arr = $('#all_imgs img').map(function() { return this.src; }).get()