Home > Article > Web Front-end > js clears the content code of the input file uploaded file
This article mainly shares with you a few lines of js code. I hope it can help you on how to clear the content of the input file and upload the file in js.
html page code is as follows:
<input id="file_input" type="file" onchange="upLoadFile(this)" value="" />
js code is as follows, you can directly clear the content of the upload file input button:
var obj=document.getElementById('file_input'); obj.outerHTML=obj.outerHTML;
Related recommendations:
Javascript implements input file upload image preview effect
Upload image preview JS script Input file image preview implementation example
##input file Upload image preview function example code
The above is the detailed content of js clears the content code of the input file uploaded file. For more information, please follow other related articles on the PHP Chinese website!