Giovanni Battista Lenoci wrote:
Maybe I confused you.You've mixed two types of syntax. You can achieve this with 2 syntax: 1. $('img').each(function(){ $('img').attr({'src': "http://localhost/s.demo/"+$(this).attr('src')}); }); 2. $('img').each(function(){ $('img').attr('src',"http://localhost/s.demo/"+$(this).attr('src')); });
You have a slight issue with the samples. The first instance of $('img') inside the function() should be $(this).
Shawn