$('#placeWithYourImages a').click(function(){ var href = $(this).attr('href'); $('img', this).attr('src', href); return false; });
This code changes only once and it is very primitive. You may wanna add an if statement to check if the href is equal to src, etc. Or add some extra code to make it toggle on each image click. Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Fri, Jan 9, 2009 at 7:00 AM, jeffreych...@gmail.com <jeffreych...@gmail.com> wrote: > > Hi devs, > > I kinda new with jquery and would like to ask, has anyone tried to use > jquery to swap images when click. Its a linked image. SO when you > click the image it would swap into another one. > > Thanks. >