JSFiddle - React, Tailwind, and code Playground
HTML
Type in a URL to an image below :<br><br>
<input type="text" id="url"/><input type="button" id="btn" value="show image" />
<br><br>
<img src="" id="img">
JavaScript
$('#btn').on('click', function() {
$('#img').attr('src', $('#url').val());
});