JSFiddle - React, Tailwind, and code Playground
by Korah Babu Varghese
HTML
<p class="form">
<input type="text" id="path" />
<label class="add-photo-btn">upload<span><input type="file" id="myfile" name="myfile" /></span>
</label>
</p>
CSS
.form input[type="file"]{
z-index: 999;
line-height: 0;
top:0;
bottom:0;
left:0;
right:0;
margin:auto;
font-size: 50px;
position: absolute;
cursor: pointer;
padding:0;
}
.add-photo-btn{
position:relative;
overflow:hidden;
cursor:pointer;
text-align:center;
background-color:#83b81a;
color:#fff;display:block;
width:197px;
height:31px;
font-size:18px;
line-height:30px;
float:left;
}
input[type="text"]{
float:left;
display:none;
}
JavaScript
$('#myfile').change(function(){
$('#path').val($(this).val());
});