这没有从根本解决问题,但这是最快的方法,哪位老铁有更好的方法,请留言:
//Just to remove error inside the console.
//If error exists then onChange event is not fired.
var fileHook = {
get: function (elem) {
return this.value;
},
set: function (elem, value) {
return this.value = value;
}
}
$.valHooks["file"] = fileHook;
翻译自: https://stackoverflow.com/questions/43612763/invalidstateerror-failed-to-set-the-value-property-on-htmlinputelement
之前看到文章是因为是文件上传时文件类型导致,望参考