title: Jquery: Get each image src
body: <p>I have a series of images each with the class "photo";</p>
  
  <p>I want to go through each of these and retrieve the photo source, for use later in an if statement. I have written the below code to do this, but have not been successful:</p>
  
  <pre><code>$.each($(".photo"), function() {
    var imgsrc = $(this).attr("src").length;
    console.log(imgsrc);
  });
  </code></pre>
  
  <p>I am not sure where I have gone wrong here. It seems to make sense to me, but I dont get anything in the console. </p>
  
  <p>Can anyone point me in the right direction?</p>