JSFiddle - React, Tailwind, and code Playground
HTML
<img id="color" height="200px" />
<table id="colorOptions" class="opts">
<tr>
<td style="font-weight: 700" colspan="2">
Color<input id="colorSortOrder" type="hidden" value="1" />
</td>
</tr>
<tr data-img="http://www.nyapplecountry.com/images/photosvarieties/redrome04.jpg">
<td>
<input id="radioRed" type="radio" name="Color" value="R-" />
<label for="radioRed">
Red</label>
<input type="hidden" value="Image1.jpg" />
</td>
<td rowspan="3">
</td>
</tr>
<tr data-img="http://appleadayproject.files.wordpress.com/2011/03/apple-full2.jpg">
<td>
<input id="radioOrange" type="radio" name="Color" value="O-" />
<label for="radioOrange">
Orange</label>
<input type="hidden" value="Image2.jpg" />
</td>
</tr>
<tr data-img="http://www.crunchbase.com/assets/images/resized/0005/4061/54061v1-max-250x250.jpg">
<td>
<input id="radioBlue" type="radio" name="Color" value="B-" />
<label for="radioBlue">
Blue</label>
<input type="hidden" value="Image3.jpg" />
</td>
</tr>
</table>
<img id="size" height="200px" />
<table id="sizeOptions" class="opts">
<tr data-img="http://www.nyapplecountry.com/images/photosvarieties/redrome04.jpg">
<td style="font-weight: 700" colspan="2">
Size<input id="sizeSortOrder" type="hidden" value="2" />
</td>
</tr>
<tr>
<td>
<input id="radioLarge" type="radio" name="Color" value="LA-" />
<label for="radioLarge">
Large</label>
<input type="hidden" value="Image4.jpg" />
</td>
<td rowspan="3">
<img />
</td>
</tr>
<tr data-img="http://www.crunchbase.com/assets/images/resized/0005/4061/54061v1-max-250x250.jpg">
<td>
...
JavaScript
$('.opts').each(function(index){
$('#' + $(this).attr('id') + ' tr').hover(function(){
var img = $(this).parent().parent().prev();
$(img).attr({"src": $(this).data('img'), "alt": $(this).data('img')});
});
});
/*
$('#colorOptions tr').hover(function(){
$("#color").attr({"src": $(this).data('img'), "alt": $(this).data('img')});
});
$("table[id^='options'] tr").hover(function () {
$("[name^='optionVal']").attr({ "src": $(this).data('img'), "alt": $(this).data('img') });
});
*/