Hey all,

I'm new to this forum but I thought I'd share a recent coding problem I've run into.

So the code..


Code:
$('.product-img-box .product-image img').attr('src', $('.more-views ul li a img[alt="' + $select.find('option:selected')[0].getAttribute('product_id') + '"]').attr('src'));
      $select[0].simulate('change');
Updates a main product image on my website. The image is also available to pop-out to show a larger image and I would like the <a href tag to also dynamically update so the updated image pops open in the new tab instead of the default image.

I am new at javascript so I tried this...

Code:
 $('.product-img-box .product-image a').attr('href', $('.more-views ul li a href[alt="' + $select.find('option:selected')[0].getAttribute('product_id') + '"]').attr('href'));
	  $select[0].simulate('change');
Which I know is probably not correct and did not work. But would you guys have any ideas on how to do this given this information?

Appreciate it!