let img1 = "//sitename.com/wp-contents/uploads/../../filename.jpg";
let img2 = "//sitename.com/wp-contents/uploads/../../filename.jpg";
let img3 = ...
jQuery("#text1").on('click', function() {
jQuery("#image").attr('src', img1);
});
jQuery("#text2").on('click', function() {
jQuery("#image").attr('src', img2);
});
jQuery("#text3").on('click', function() {
jQuery("#image").attr('src', img3);
});
Obviously, modify the code as needed. You can just include this in your HTML inside of a <script></script> tag in the text editor (not the visual editor). If you’re using Gutenberg, you can use an HTML block to put this in.
]]>