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

js clears the content code of the input file uploaded file

小云云
Release: 2018-05-17 10:44:40
Original
3288 people have browsed it

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="" />
Copy after login

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template