<html><body>
清空File控件的内容:<br/>
方法一:(测试成功)
<input type="file" name="File1"/>
<input type="button" onclick="File1.select();document.execCommand(‘Delete‘);" value="清除file的内容"/>
<hr/>
方法二:(测试成功)
<table>
<tr>
<td>
<input type="file" name="attachment"/>
<input name="deleteAtta" type="button" value="清除file的内容" onClick="this.parentElement.innerHTML+=‘‘;"/>
</td>
</tr>
</table>
<hr/>
file控件赋值:
<input type="file" name="File2"/>
<input type="button" onclick="File2.select();document.execCommand(‘Delete‘);" value="清除file的内容"/>
<input type="button" onclick="news()" value="新值"/>
<hr/>
<script>
function news(){
File2.focus();
var WshShell=new ActiveXObject("WScript.Shell");
WshShell.sendKeys("D:\\YingSoft\\YingJAD\\ShellApp.ini");//此文件必须是已经存在的
}
</script>
</body></html>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。