Home  >  Article  >  Web Front-end  >  js clears the content code of the input file uploaded file

js clears the content code of the input file uploaded file

小云云
小云云Original
2018-05-17 10:44:403265browse

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(&#39;file_input&#39;);
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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn