打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
File控件文本框的传值和清空
<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>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
清空<input type=file 标签
ASP.Net中FileUpLoad控件内容清空
定义input type=file 样式的方法
使用ScriptX进行复杂的WEB打印设置
调用WB.ExecWB控件的方法
如何在代码中将一个disabled的按钮激活
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服