HTML上传控件取消选择
JS代码
<input type="file" id="fileupload" name="file" />
第一种: (display:none时不能用)
代码如下:
var obj = document.getElementById('fileupload') ; obj.select(); document.execCommand("delete");
第二种:(无论display:none或block都可以用)
代码如下:
var obj = document.getElementById('fileupload') ; obj.outerHTML=obj.outerHTML;
相关推荐
javamagicsun 2019-11-10
shumark 2014-07-07
RoyKings 2015-10-31
Sweetdream 2013-02-24
牧场SZShepherd 2012-03-20
南鹏飞技术 2016-06-11
ApachePHPMySQL 2012-02-15
dinux 2016-01-19
Andrewtao00 2011-10-23
shangsoft 2011-10-22
ISEESTARS 2011-09-07
ziyifengfei 2015-07-28
ErixHao 2011-03-30
jacky的部落 2011-03-29
zrtlin 2014-07-24
jackyzhuyuanlu 2014-07-07