var obj= Web page <input type= "file"/> obj.outerhtml = Obj.outerhtml.replace (/(value=). + "/I," $ ");
More classic approach
You need to clear the value of the <input type= "file" >, but the value of the upload control <input type= "file" > cannot be modified by the Web effect.
Google found a workaround:
Inserting a value in the upload control only clears the form's reset function, but the other values in the form are reset.
Since you can use the reset of the form to empty, there is a way: Create a temporary form, and then the need to empty the upload control to move into it, reset, then move back to the original location, and finally delete the created temporary form. Web page Special effects code:
Web page Special effects code
var upload = {
clear:function (ID) {
var up = (typeof id== "string")? document.getElementById (ID): ID;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.