JSFiddle - React, Tailwind, and code Playground
by Dennis Betman
HTML
<input type="file" id="file" />
<button id="test2">Insert</button>
<div id="test"></div>
<div id="test3"></div>
JavaScript
$("#test2").click(function(){
var number = 1 + Math.floor(Math.random() * 99999999999);
var filename = $('input[type=file]').val().replace(/C:\\fakepath\\/i, '');
var filename2 = filename.replace(filename, number);
//$("#test").html('<img src="' + file + '" id="test" /> ');
var test = $("#test").html("http://www.jewelbeast.com/preview/" + filename2 + ".png");
$("#test3").html("<img src='" + test + "' /> ");
});