I am working on a project where I would like to click a link and call
a jQuery function to swap some images. I have this working just with
javascript, but I am stuck in syntax errors with jQuery. Essentially,
I want to duplicate the functionality triggered by the link below.


<a href="#" rel="{image_url}" onClick="swapImage(this.rel)"><img /></
a>

//-----------Javascript-------------//

function swapImage(i){

//alert(i);

var image = document.getElementById('swap_image');

image.src = i;

}

//-----------------------------------//

Thanks for any help,
Jason

Reply via email to