小问题:如何清除中的内容,谢谢

huamulan 2004-11-22 11:49:11
<input id="file1" readonly type="text" name="file1" value="">

输入内容并提交后,按IE的“后退”后,刚才输入的内容还在,问题:如何将它的内容清空?

谢谢
...全文
109 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
huamulan 2004-11-22
  • 打赏
  • 举报
回复
行啦,谢谢meizz(梅花雪),结题
huamulan 2004-11-22
  • 打赏
  • 举报
回复
自动清除是什么含义?总得有个触发事件吧

按IE的“后退”按钮,或go(-1),则触发什么事件?
meizz 2004-11-22
  • 打赏
  • 举报
回复
<BODY onload="document.all.file1.select();document.execCommand('Delete');">

<input type=file id=file1>
huamulan 2004-11-22
  • 打赏
  • 举报
回复
meizz(梅花雪) 帮忙帮到底,谢谢啦
Ronanljy 2004-11-22
  • 打赏
  • 举报
回复
不是,需要自动清除,不需要人工干预

自动清除是什么含义?总得有个触发事件吧,然后再把meizz(梅花雪)兄的代码贴到事件的处理过程中去。
huamulan 2004-11-22
  • 打赏
  • 举报
回复
不对呀,内容还在!!!!

<BODY onload="file1.select();document.execCommand('Delete');">
meizz 2004-11-22
  • 打赏
  • 举报
回复
<body onload="ttt.select();document.execCommand('Delete');">
<input type=file name=ttt>

代码都给你了, 自己组合呀
huamulan 2004-11-22
  • 打赏
  • 举报
回复
不是,需要自动清除,不需要人工干预
meizz 2004-11-22
  • 打赏
  • 举报
回复
<input type=file name=ttt>
<input type=button onclick="ttt.select();document.execCommand('Delete');" value=清除file框的内容>

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧