On May 6, 12:38 am, Equand <[EMAIL PROTECTED]> wrote:
> hi all,
> i'm a newbie in javascript and jquery also.
> could you please help
> i'm trying to write a function to do onclick of a div called img to
> change img in div called 'preview'
> how do i make it replace with an image which is taken from <a href="">
> attribute of the img div?
> $(".img").click(function(){
> $(".preview img").stopAll().before('').remove();

I am sorry to say but you are little ambiguous in what you wanna do. I
assume you are trying to replace an image in a div by clicking on
another div and the image you are placing is defined in a link???

If this is what you want mey be this can help

$("#img").click(function(){
var newimg = $(a.some_class).attr("href");
$("#preview").html('<img src="'+newimg+'">');
});

I may have understood your question very well. Hope it helps.

Reply via email to