亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to keep the last selected file when deselecting <input type="file">
天蓬老師
天蓬老師 2017-07-05 11:08:02
0
2
2072

After selecting the file for the first time, click the button again. After the dialog box pops up, you do not select the file but choose to cancel. The file selected for the first time is gone. . . Showing no files selected

天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~

reply all(2)
我想大聲告訴你

Try this https://stackoverflow.com/que...

劉奇

If you have special needs, you can use a temporary variable to save the value of the last operation, for example, after the file selection event is triggered

var prevFile = null;

fileElement.onchange = function(){
    var file = fileElement.files[0] || prevFile;
    if(!file) return false;
    
    ///此處省略一大段邏輯///
    prevFile = file;
};
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template