JSFiddle - React, Tailwind, and code Playground
by Chris Rebert
HTML
<input type="text" value="A" id="q">
JavaScript
var input = document.getElementById('q');
input.type = "file";
input.type = "text";
alert('"' + input.getAttribute("value") + '"');