欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

HTML上傳控件取消選擇

 更新時(shí)間:2013年03月06日 14:52:48   作者:  
由于<input type="file">的value屬性石只讀的,所以要取消選擇只能通過其他途徑,此處有2種方法

JS代碼
<input type="file" id="fileupload" name="file" /> 

第一種: (display:none時(shí)不能用)

復(fù)制代碼 代碼如下:

var obj = document.getElementById('fileupload') ;  
obj.select();  
document.execCommand("delete");

第二種:(無(wú)論display:none或block都可以用)

復(fù)制代碼 代碼如下:

var obj = document.getElementById('fileupload') ;  
obj.outerHTML=obj.outerHTML;

相關(guān)文章

最新評(píng)論