JSFiddle - React, Tailwind, and code Playground

HTML

<img src="http://placehold.it/300x150" id="theImage">

<p><a href="#" class="yourClass" data-img="http://placehold.it/300x150/f00">Red</a></p>
    <p><a href="#" class="yourClass" data-img="http://placehold.it/300x150/00f">Blue</a></p>

JavaScript

$('.yourClass').hover(function() {
    var newImg = $(this).data('img');
    $('#theImage').attr('src',newImg)
}, function() {
 $('#theImage').attr('src','http://placehold.it/300x150')
});