You can use jQuery and the wrap()
function to loop through all images in the list and put a link around it, the following example will navigate to the image itself.
$(document).ready(function(){
$('.selected img').each(function(){
$(this).wrap('<a href="' + $(this).attr('src') +'"></a>');
})
})
If you want to add a link to another page/site replace $(this).wrap('<a href="' + $(this).attr('src') +'"></a>')
with $(this).wrap('<a href="www.google.com"></a>')
like this
$(document).ready(function(){
$('.selected img').each(function(){
$(this).wrap('<a href="www.google.com"></a>');
})
})
If you want to use javascript to just navigate to another website after clicking on the image you you can set window.location.href
on the click event like such
$(document).ready(function(){
$('.selected img').click(function(){
window.location.href='www.google.com';
})
})