今天在開心網(wǎng)逛的時(shí)候發(fā)現(xiàn)他上傳圖片的時(shí)候用了一個(gè)操作
很好的解決了firefox在點(diǎn)擊瀏覽文件之后不能清楚文本框里的值的問題
于是就像這個(gè)該怎么實(shí)現(xiàn)
結(jié)果沒想出來,不過google一下終于還是找到了解決辦法
不曉得是不是最好的,但可以先留著以防萬一要用呢
呵呵

引于下面這個(gè)bolg:http://www.x2blog.cn/SupNate/?tid=15693
//清空文件上傳框
function clearFileInput(file){
    
var form=document.createElement('form');
    document.body.appendChild(form);
    
//記住file在舊表單中的的位置
    var pos=file.nextSibling;
    form.appendChild(file);
    form.reset();
    pos.parentNode.insertBefore(file,pos);
    document.body.removeChild(form);
}