上传文件时,选择了文件后想清空文件路径,搜索了一下,用两种方法解决 

<input type="file" id="fileupload" name="file" /> 

第一种: 

var obj = document.getElementById('fileupload') ; 
obj.select(); 
document.selection.clear();

第二种: 

var obj = document.getElementById('fileupload') ; 
obj.outerHTML=obj.outerHTML; 

 

相关文章:

  • 2022-12-23
  • 2022-02-07
  • 2021-12-16
  • 2021-09-23
  • 2021-07-14
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2021-10-19
  • 2022-02-07
  • 2022-02-07
  • 2022-02-07
  • 2022-12-23
相关资源
相似解决方案