I'm trying to get the file through input
.
I hide the input through CSS and gave the label a style. There is a problem here.
If input is hidden, the default input button cannot support the supported get file name. I guess Vanila JS can solve this, but I don't know what to do. I tried to get the value value of the file and put it in the box specified as inner HTML, but it didn't work.
.submit{
width:140px;
height:40px;
background-color:red;
color:#fff;
text-align:center;
padding:10px;
line-height:40px;
cursor:pointer;
}
<input type="file" id="test" style="display:none;">
<label for="test">
<span class="submit">submit</span>
<span id="test2">filename</span>
</label>