JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<p>This is a test</p>
<img src="http://placeimg.com/98/100/animals" />
<a href="http://placeimg.com/98/100/animals">View the Image</a>
</div>
<div>
<p>This is a test</p>
<img src="http://placeimg.com/100/95/animals" />
<a href="http://placeimg.com/100/95/animals">View the Image</a>
</div>
<div>
<p>This is a test</p>
<img src="http://placeimg.com/95/95/animals" />
<a href="http://placeimg.com/95/95/animals">View the Image</a>
</div>
<div id="msg"></div>
CSS
#msg{position:absolute;top:30%;left:40%;}
JavaScript
$('p+img').click(function(){
var i = $(this).next('a').attr('href');
//alert(i);
$('#msg').html('<img src="'+i+'" class="msg" width="200" height="200" />');
});