JSFiddle - React, Tailwind, and code Playground
HTML
<img id="image" src="http://lorempixel.com/output/nightlife-q-c-200-200-4.jpg" data-myvalue="image one clicked" alt="">
<input type="text" id="input" value="">
JavaScript
// add event handler to the image
$('#image').click( function(event) {
// put value into the inout field
$('#input').val( $(this).data('myvalue') );
});