Basically I’m trying to grab the SRC of an image, wrap it in an anchor which then uses the SRC of the img as it’s HREF, I’ve so far got the following code, but I’m a bit stuck as to how to finish it off, any ideas?
$('#detail img').wrap(function() {
return '<a href="" rel="one" class="fancybox" />';
});
$('#detail img a').attr('src',$('#detail img').attr('src'));
By the way, if you can modify initial HTML it’s better then doing this with JS.