title: Passing div element to success callback jquery
body: <p>I am using lis to obtain a list of <code>&lt;li&gt;</code> from my DOM, and in each LI  and update the projectPhoto after the ajax call. But my "li" in the callback function always referring to the last item in <code>lis</code>, is there any way to overcome this, or such as pass as value ?</p>
  
  <p>p/s: I am pretty sure this has been discussed before just that I can't reach it with the right terminology. Apology in advance.</p>
  
  <pre><code>var lis = $('.porject_list li');
     for (var i = 0; i &lt; lis.length; i++) {
  
          var li = lis.eq(i);
  var projectId = li.attr('data-project-id');
  
  
              $.get("/webapi/projects/projectphoto/" + projectId, function (res) {
                  $("img", li).attr('src', res);
              });
      }
  </code></pre>