How to get the src attribute of all images on a page with jQuery

How to get the src attribute of all images on a page with jQuery

I am trying to get and use the src attributes of all the images on a page.However, my code returns only 1 src attribute of the images except when run inside the each function. Any ideas of what I am not getting right?

  1. jQuery(".clicker").click(function() { var imgWalt = ""; jQuery.each(jQuery("img"), function() { imgWalt = "<img src='" + jQuery(this).attr("src") + "' />"; }); alert(imgWalt); });

See the working code on jsFiddle