JSFiddle - React, Tailwind, and code Playground

HTML

<input type="file" id="imgInput"/>
<button type="button" id="btnShowImg">Mostrar imagen</button>
<img id="img" src=""/>

CSS

#img {
    background-size: cover;
    border: 5px solid #eee;
    display: block;
    height: 150px;
    margin: 25px auto;
    width: 150px;
}

JavaScript

$(document).on('ready', function() {
    $('#btnShowImg').on('click', function() {
        var file = document.querySelector('#imgInput').files[0];
        var blob = URL.createObjectURL(file);
        document.querySelector('#img').src = blob;
    })
})