JSFiddle - React, Tailwind, and code Playground

by lollero

HTML

<!-- with input that accepts one file -->
<input id="the-file-input" type="file">

JavaScript

// detect a change in a file input with an id of “the-file-input”
$("#the-file-input").change(function() {
    // will log a FileList object, view gifs below
    console.log(this.files[0]);
    $('<img src="'+ this.files[0] +'"/>').appendTo('body');
});