JSFiddle - React, Tailwind, and code Playground
by calder12
HTML
<input type="text" id="imgsrc" style="width:500px"/>
<div>
<img src="https://placeimg.com/100/100/any"/>
</div>
<div>
<img src="https://placeimg.com/100/100/arch"/>
</div>
<div>
<img src="https://placeimg.com/100/100/tech"/>
</div>
JavaScript
$('img').on('click', function() {
$('#imgsrc').val( $(this).attr('src') )
})