解决Jquery对input file控件的onchange事件只生效一次的问题

如题,解决办法的代码如下:

1.

$('#fileId').live('change',function(){ //逻辑添加.... }); 

2.

$('#fileId').change(function(){

$('#inputFileID').replaceWith('<input name="fileToUpload" type="file" id="inputFileID"  />');

});

 

原文地址:https://www.cnblogs.com/talentzemin/p/3921828.html