清空file控件的值
<input type="file" name="fileName" id="fileID">
<input type="button" value="清空" onclick="clearFile()"/>
1 <script language="javascript">
2 function clearFile(){
3 var obj = document.getElementById("fileID");
4 obj.outerHTML = obj.outerHTML;
5 }
6 </script>
2 function clearFile(){
3 var obj = document.getElementById("fileID");
4 obj.outerHTML = obj.outerHTML;
5 }
6 </script>